Rewrite tests that should fail so that they actually do

This commit is contained in:
Mathieu Magnin 2017-06-20 15:55:17 +02:00
parent 3f1da18cfb
commit 58350f219a
2 changed files with 6 additions and 2 deletions

View file

@ -7,6 +7,7 @@ describe Administrateurs::SessionsController, type: :controller do
describe '.demo' do
subject { get :demo }
render_views
context 'when rails env is production' do
before do
@ -20,8 +21,9 @@ describe Administrateurs::SessionsController, type: :controller do
it { expect(subject.status).to eq 200 }
it 'Administrateur demo is initiated' do
expect(User).to receive(:new).with(email: 'admin@tps.fr', password: 'password').and_return(Administrateur)
subject
expect(response.body).to have_css("input#user_email[value='admin@tps.fr']")
expect(response.body).to have_css("input#user_password[value='password']")
end
end
end

View file

@ -7,6 +7,7 @@ describe Gestionnaires::SessionsController, type: :controller do
describe '.demo' do
subject { get :demo }
render_views
context 'when rails env is production' do
before do
@ -20,8 +21,9 @@ describe Gestionnaires::SessionsController, type: :controller do
it { expect(subject.status).to eq 200 }
it 'Gestionnaire demo is initiated' do
expect(User).to receive(:new).with(email: 'gestionnaire@apientreprise.fr', password: 'password').and_return(Gestionnaire)
subject
expect(response.body).to have_css("input#user_email[value='gestionnaire@apientreprise.fr']")
expect(response.body).to have_css("input#user_password[value='password']")
end
end
end