summaryrefslogtreecommitdiff
path: root/spec/models/project_services/hipchat_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/project_services/hipchat_service_spec.rb')
-rw-r--r--spec/models/project_services/hipchat_service_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb
index 4707673269a..65d16beef91 100644
--- a/spec/models/project_services/hipchat_service_spec.rb
+++ b/spec/models/project_services/hipchat_service_spec.rb
@@ -47,6 +47,14 @@ describe HipchatService do
WebMock.stub_request(:post, api_url)
end
+ it 'should test and return errors' do
+ allow(hipchat).to receive(:execute).and_raise(StandardError, 'no such room')
+ result = hipchat.test(push_sample_data)
+
+ expect(result[:success]).to be_falsey
+ expect(result[:result].to_s).to eq('no such room')
+ end
+
it 'should use v1 if version is provided' do
allow(hipchat).to receive(:api_version).and_return('v1')
expect(HipChat::Client).to receive(:new).