diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-22 00:49:06 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-06-22 13:13:46 +0300 |
commit | 5a9ede472150ec78f8410ae15cf782095c8f056c (patch) | |
tree | 5cbdbfb971329960011e8b3a3544e583f9551f6c /spec/models/project_services/hipchat_service_spec.rb | |
parent | dad88568f34bfda5f7fe34672bc5099c80226138 (diff) |
Update mock and stub syntax for specs
Diffstat (limited to 'spec/models/project_services/hipchat_service_spec.rb')
-rw-r--r-- | spec/models/project_services/hipchat_service_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb index e88615e1a2e..8ed03dd1da8 100644 --- a/spec/models/project_services/hipchat_service_spec.rb +++ b/spec/models/project_services/hipchat_service_spec.rb @@ -37,7 +37,7 @@ describe HipchatService do let(:push_sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) } before(:each) do - hipchat.stub( + allow(hipchat).to receive_messages( project_id: project.id, project: project, room: 123456, @@ -48,7 +48,7 @@ describe HipchatService do end it 'should use v1 if version is provided' do - hipchat.stub(api_version: 'v1') + allow(hipchat).to receive(:api_version).and_return('v1') expect(HipChat::Client).to receive(:new). with(token, api_version: 'v1', @@ -59,7 +59,7 @@ describe HipchatService do end it 'should use v2 as the version when nothing is provided' do - hipchat.stub(api_version: '') + allow(hipchat).to receive(:api_version).and_return('') expect(HipChat::Client).to receive(:new). with(token, api_version: 'v2', @@ -245,12 +245,12 @@ describe HipchatService do end it "should set notfiy to true" do - hipchat.stub(notify: '1') + allow(hipchat).to receive(:notify).and_return('1') expect(hipchat.send(:message_options)).to eq({notify: true, color: 'yellow'}) end it "should set the color" do - hipchat.stub(color: 'red') + allow(hipchat).to receive(:color).and_return('red') expect(hipchat.send(:message_options)).to eq({notify: false, color: 'red'}) end end |