demarches-normaliennes/spec/system/users/sign_in_spec.rb
2024-01-30 10:03:00 +01:00

23 lines
643 B
Ruby

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