Get tests passing.
This commit is contained in:
parent
00bfb645e1
commit
83fb119020
|
@ -61,16 +61,17 @@ feature 'Users', feature: true, js: true do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
visit new_user_session_path
|
visit new_user_session_path
|
||||||
click_link 'Register'
|
click_link 'Register'
|
||||||
@username_field = find '.username'
|
@username_form_group = find '.username'
|
||||||
|
@username_field = find '#new_user_username'
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'shows an error border if the username already exists' do
|
scenario 'shows an error border if the username already exists', focus: true do
|
||||||
fill_in username_input, with: user.username
|
fill_in username_input, with: user.username
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
expect(@username_field).to have_css '.gl-field-error-outline'
|
expect(@username_form_group).to have_css '.gl-field-error-outline'
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'doesn\'t show an error border if the username is available' do
|
scenario 'doesn\'t show an error border if the username is available', focus: true do
|
||||||
fill_in username_input, with: 'new-user'
|
fill_in username_input, with: 'new-user'
|
||||||
wait_for_ajax
|
wait_for_ajax
|
||||||
expect(@username_field).not_to have_css '.gl-field-error-outline'
|
expect(@username_field).not_to have_css '.gl-field-error-outline'
|
||||||
|
|
|
@ -33,7 +33,9 @@ module LoginHelpers
|
||||||
fill_in "user_login", with: user.email
|
fill_in "user_login", with: user.email
|
||||||
fill_in "user_password", with: "12345678"
|
fill_in "user_password", with: "12345678"
|
||||||
check 'user_remember_me' if remember
|
check 'user_remember_me' if remember
|
||||||
click_button "Sign in"
|
page.within '.login-box' do
|
||||||
|
click_button "Sign in"
|
||||||
|
end
|
||||||
Thread.current[:current_user] = user
|
Thread.current[:current_user] = user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue