Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-13 14:43:44 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-08-13 14:43:44 +0300
commit00a33d67aa5dfcfbc63182106162041d2c60f4de (patch)
tree73035cff0dc392f1bce5f7a3388294afa686a457 /spec/models
parent167ab75365b35b9ff10c399e1c3b97f3b3aeb351 (diff)
parent23790570026ce78e3b4cbbf1b2f32ada992c5f40 (diff)
Merge branch 'improve-hipchat-service-test' into 'master'
Provide more feedback what went wrong if HipChat service failed test This MR adds support for displaying the error message during HipChat service test. Before an Error 500 would be displayed with no helpful remarks. Screenshot: ![image](https://gitlab.com/stanhu/gitlab-ce/uploads/10f82eb02db138f9680e69cdb3d3ed82/image.png) Issue gitlab-com/support-forum#213 See merge request !1144
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_services/hipchat_service_spec.rb8
-rw-r--r--spec/models/service_spec.rb10
2 files changed, 18 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).
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index ca11758ee06..a213ffe6c4b 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -46,6 +46,16 @@ describe Service do
describe :can_test do
it { expect(@testable).to eq(true) }
end
+
+ describe :test do
+ let(:data) { 'test' }
+
+ it 'test runs execute' do
+ expect(@service).to receive(:execute).with(data)
+
+ @service.test(data)
+ end
+ end
end
describe "With commits" do