2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-01-30 10:03:00 +01:00
|
|
|
describe 'Sign in', js: true do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
scenario 'when a user is logged in english' do
|
|
|
|
visit root_path
|
|
|
|
|
|
|
|
within(".fr-header__tools") do
|
|
|
|
find('.fr-translate__btn').click
|
|
|
|
end
|
|
|
|
within("#translate") do
|
|
|
|
click_on("EN - English")
|
|
|
|
end
|
|
|
|
expect(page).to have_content("Sign in")
|
|
|
|
within(".fr-header__tools") do
|
|
|
|
click_on("Sign in")
|
|
|
|
end
|
|
|
|
expect(page).to have_content("With FranceConnect")
|
|
|
|
fill_in(:user_email, with: user.email)
|
|
|
|
fill_in(:user_password, with: 'wrong password')
|
|
|
|
click_on("Sign in")
|
|
|
|
expect(page).to have_content("Invalid Email or password.")
|
|
|
|
end
|
|
|
|
end
|