Fix several rubocop warnings

Metrics/LineLength: Line is too long.
RSpec/InstanceVariable: Use let instead of an instance variable.
Layout/TrailingBlankLines: Final newline missing.
Style/StringLiterals: Prefer double-quoted strings.
This commit is contained in:
Julian Herrero
2019-03-30 19:02:37 +01:00
parent 83e129d5b7
commit 6e88031537
14 changed files with 230 additions and 114 deletions

View File

@@ -5,7 +5,9 @@ describe Management::SessionsController do
describe "Sign in" do
it "denies access if wrong manager credentials" do
allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(false)
expect { get :create, params: { login: "nonexistent" , clave_usuario: "wrong" }}.to raise_error CanCan::AccessDenied
expect {
get :create, params: { login: "nonexistent", clave_usuario: "wrong" }
}.to raise_error CanCan::AccessDenied
expect(session[:manager]).to be_nil
end
@@ -13,7 +15,11 @@ describe Management::SessionsController do
manager = {login: "JJB033", user_key: "31415926", date: "20151031135905"}
allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(manager)
get :create, params: { login: "JJB033" , clave_usuario: "31415926", fecha_conexion: "20151031135905" }
get :create, params: {
login: "JJB033" ,
clave_usuario: "31415926",
fecha_conexion: "20151031135905"
}
expect(response).to be_redirect
expect(session[:manager][:login]).to eq "JJB033"
end
@@ -56,4 +62,4 @@ describe Management::SessionsController do
end
end
end
end