add feature test on france connect

This commit is contained in:
Tanguy PATTE 2015-10-06 17:22:06 +02:00
parent 8445944b76
commit f4e3ec1a72

View file

@ -12,5 +12,16 @@ feature 'France Connect Connexion' do
expect(page).to have_css('a#france_connect')
end
context 'and click on france connect link' do
let(:code) { 'plop' }
before do
allow_any_instance_of(FranceConnectClient).to receive(:authorization_uri).and_return(france_connect_callback_path(code: code))
allow(FranceConnectService).to receive(:retrieve_user_informations).and_return(Hashie::Mash.new(email: 'patator@cake.com'))
page.find_by_id('france_connect').click
end
scenario 'he is redirected to france connect' do
expect(page).to have_content('Vos dossiers')
end
end
end
end