diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-06-26 17:59:32 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-06-26 18:00:01 -0700 |
commit | 7ef3cf64d6d6af9941401af748274677ff3af15d (patch) | |
tree | d5d0d4957b509b69d8f4bb93fb719fb540041898 | |
parent | e57d1bbf138aadd9c54a3e886d66d8b02e2497ae (diff) | |
download | gitlab-ce-7ef3cf64d6d6af9941401af748274677ff3af15d.tar.gz |
rm use of deprecated webmock api in campfire_service_spec
-rw-r--r-- | spec/models/project_services/campfire_service_spec.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/models/project_services/campfire_service_spec.rb b/spec/models/project_services/campfire_service_spec.rb index de55627dd27..56ff3596190 100644 --- a/spec/models/project_services/campfire_service_spec.rb +++ b/spec/models/project_services/campfire_service_spec.rb @@ -39,21 +39,22 @@ describe CampfireService, models: true do room: 'test-room' ) @sample_data = Gitlab::DataBuilder::Push.build_sample(project, user) - @rooms_url = 'https://verySecret:X@project-name.campfirenow.com/rooms.json' + @rooms_url = 'https://project-name.campfirenow.com/rooms.json' + @auth = %w(verySecret X) @headers = { 'Content-Type' => 'application/json; charset=utf-8' } end it "calls Campfire API to get a list of rooms and speak in a room" do # make sure a valid list of rooms is returned body = File.read(Rails.root + 'spec/fixtures/project_services/campfire/rooms.json') - WebMock.stub_request(:get, @rooms_url).to_return( + WebMock.stub_request(:get, @rooms_url).with(basic_auth: @auth).to_return( body: body, status: 200, headers: @headers ) # stub the speak request with the room id found in the previous request's response - speak_url = 'https://verySecret:X@project-name.campfirenow.com/room/123/speak.json' - WebMock.stub_request(:post, speak_url) + speak_url = 'https://project-name.campfirenow.com/room/123/speak.json' + WebMock.stub_request(:post, speak_url).with(basic_auth: @auth) @campfire_service.execute(@sample_data) @@ -66,7 +67,7 @@ describe CampfireService, models: true do it "calls Campfire API to get a list of rooms but shouldn't speak in a room" do # return a list of rooms that do not contain a room named 'test-room' body = File.read(Rails.root + 'spec/fixtures/project_services/campfire/rooms2.json') - WebMock.stub_request(:get, @rooms_url).to_return( + WebMock.stub_request(:get, @rooms_url).with(basic_auth: @auth).to_return( body: body, status: 200, headers: @headers |