mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +01:00
24 lines
613 B
Ruby
24 lines
613 B
Ruby
require 'test_helper'
|
|
|
|
class AuthenticationTest < ActionDispatch::IntegrationTest
|
|
test 'register via first time sign in and sign out' do
|
|
visit '/auth/developer'
|
|
fill_in 'Name', with: 'me'
|
|
fill_in 'Email', with: 'user@example.com'
|
|
click_button 'Sign In'
|
|
assert_equal '/', current_path
|
|
assert_is_signed_in
|
|
|
|
click_link 'Abmelden'
|
|
assert_equal '/', current_path
|
|
assert_is_signed_out
|
|
end
|
|
|
|
def assert_is_signed_in
|
|
assert_equal 'Abmelden', find('[data-logout]').text
|
|
end
|
|
|
|
def assert_is_signed_out
|
|
assert_equal 'Anmelden', find('[data-persona-login]').text
|
|
end
|
|
end
|