From 2f3df4cb567a6f14b5a0e161084c2f4cf6fbf764 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sat, 8 Nov 2014 23:12:14 -0600 Subject: [PATCH] HipChat service: correct service name & use v2 API HipChat refers to their own product camel cased so we should do the same. HipChat no longer recommends people use the deprecated v1 API so switch to using the v2 API by default. hipchat-rb does not yet default to v2 in any version so it must be specified. --- Gemfile | 2 +- Gemfile.lock | 5 ++--- app/models/project_services/hipchat_service.rb | 5 +++-- features/steps/project/services.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 2c4274dcf3d..613ef11cf4d 100644 --- a/Gemfile +++ b/Gemfile @@ -134,7 +134,7 @@ gem "redis-rails" gem 'tinder', '~> 1.9.2' # HipChat integration -gem "hipchat", "~> 0.14.0" +gem "hipchat", "~> 1.4.0" # Flowdock integration gem "gitlab-flowdock-git-hook", "~> 0.4.2" diff --git a/Gemfile.lock b/Gemfile.lock index 938ce560620..b6c1dcfa331 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -235,8 +235,7 @@ GEM railties (>= 4.0.1) hashie (2.1.2) hike (1.2.3) - hipchat (0.14.0) - httparty + hipchat (1.4.0) httparty html-pipeline (1.11.0) activesupport (>= 2) @@ -636,7 +635,7 @@ DEPENDENCIES guard-rspec guard-spinach haml-rails - hipchat (~> 0.14.0) + hipchat (~> 1.4.0) html-pipeline-gitlab (~> 0.1.0) httparty jasmine (= 2.0.2) diff --git a/app/models/project_services/hipchat_service.rb b/app/models/project_services/hipchat_service.rb index 4078938cdbb..2b804687853 100644 --- a/app/models/project_services/hipchat_service.rb +++ b/app/models/project_services/hipchat_service.rb @@ -19,7 +19,7 @@ class HipchatService < Service validates :token, presence: true, if: :activated? def title - 'Hipchat' + 'HipChat' end def description @@ -44,7 +44,8 @@ class HipchatService < Service private def gate - @gate ||= HipChat::Client.new(token) + options = { api_version: 'v2' } + @gate ||= HipChat::Client.new(token, options) end def create_message(push) diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index d5d58070d86..ffc231cb575 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -10,7 +10,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps step 'I should see list of available services' do page.should have_content 'Project services' page.should have_content 'Campfire' - page.should have_content 'Hipchat' + page.should have_content 'HipChat' page.should have_content 'GitLab CI' page.should have_content 'Assembla' page.should have_content 'Pushover' @@ -33,7 +33,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I click hipchat service link' do - click_link 'Hipchat' + click_link 'HipChat' end step 'I fill hipchat settings' do