Add and apply RSpec/ReceiveMessages rubocop rule
This rule was added in rubocop-rspec 2.23.0. I didn't know this method existed, and it makes the code more readable in some cases.
This commit is contained in:
@@ -39,22 +39,19 @@ describe ManagerAuthenticator do
|
||||
|
||||
describe "#auth" do
|
||||
it "returns false if not manager_exists" do
|
||||
allow(authenticator).to receive(:manager_exists?).and_return(false)
|
||||
allow(authenticator).to receive(:application_authorized?).and_return(true)
|
||||
allow(authenticator).to receive_messages(manager_exists?: false, application_authorized?: true)
|
||||
|
||||
expect(authenticator.auth).to be false
|
||||
end
|
||||
|
||||
it "returns false if not application_authorized" do
|
||||
allow(authenticator).to receive(:manager_exists?).and_return(true)
|
||||
allow(authenticator).to receive(:application_authorized?).and_return(false)
|
||||
allow(authenticator).to receive_messages(manager_exists?: true, application_authorized?: false)
|
||||
|
||||
expect(authenticator.auth).to be false
|
||||
end
|
||||
|
||||
it "returns ok if manager_exists and application_authorized" do
|
||||
allow(authenticator).to receive(:manager_exists?).and_return(true)
|
||||
allow(authenticator).to receive(:application_authorized?).and_return(true)
|
||||
allow(authenticator).to receive_messages(manager_exists?: true, application_authorized?: true)
|
||||
|
||||
expect(authenticator.auth).to be_truthy
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user