2016-05-26 15:59:50 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'users/sessions/new.html.haml', type: :view do
|
|
|
|
let(:dossier) { create :dossier }
|
|
|
|
|
|
|
|
before(:each) do
|
|
|
|
allow(view).to receive(:devise_mapping).and_return(Devise.mappings[:user])
|
|
|
|
allow(view).to receive(:resource_name).and_return(:user)
|
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
|
|
|
assign(:user, User.new)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when user_return_to session params contains a procedure_id' do
|
|
|
|
before do
|
|
|
|
assign(:dossier, dossier)
|
|
|
|
render
|
|
|
|
end
|
|
|
|
|
2017-06-13 17:46:08 +02:00
|
|
|
it { expect(rendered).to have_selector('.procedure-logos') }
|
2016-05-26 15:59:50 +02:00
|
|
|
it { expect(rendered).to have_content(dossier.procedure.libelle) }
|
|
|
|
it { expect(rendered).to have_content(dossier.procedure.description) }
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when user_return_to session params not contains a procedure_id' do
|
|
|
|
before do
|
|
|
|
render
|
|
|
|
end
|
|
|
|
|
2017-06-13 17:46:08 +02:00
|
|
|
it { expect(rendered).to have_content('Un outil simple') }
|
2016-05-26 15:59:50 +02:00
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|