Enable RSpec/MessageExpectation cop & fix issues
There was 34 `allow` occurences and 17 `expect` occurences, so to be consistent `allow` form was chosen. Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
This commit is contained in:
@@ -46,7 +46,7 @@ describe CensusApi do
|
||||
it "returns the response for the first valid variant" do
|
||||
allow(api).to receive(:get_response_body).with(1, "00123456").and_return(invalid_body)
|
||||
allow(api).to receive(:get_response_body).with(1, "123456").and_return(invalid_body)
|
||||
expect(api).to receive(:get_response_body).with(1, "0123456").and_return(valid_body)
|
||||
allow(api).to receive(:get_response_body).with(1, "0123456").and_return(valid_body)
|
||||
|
||||
response = api.call(1, "123456")
|
||||
|
||||
@@ -55,9 +55,9 @@ describe CensusApi do
|
||||
end
|
||||
|
||||
it "returns the last failed response" do
|
||||
expect(api).to receive(:get_response_body).with(1, "00123456").and_return(invalid_body)
|
||||
expect(api).to receive(:get_response_body).with(1, "123456").and_return(invalid_body)
|
||||
expect(api).to receive(:get_response_body).with(1, "0123456").and_return(invalid_body)
|
||||
allow(api).to receive(:get_response_body).with(1, "00123456").and_return(invalid_body)
|
||||
allow(api).to receive(:get_response_body).with(1, "123456").and_return(invalid_body)
|
||||
allow(api).to receive(:get_response_body).with(1, "0123456").and_return(invalid_body)
|
||||
response = api.call(1, "123456")
|
||||
|
||||
expect(response).to_not be_valid
|
||||
|
||||
Reference in New Issue
Block a user