Skip to content

Commit

Permalink
[ci] Be sure that the user is logged in inside feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Moises Deniz Aleman authored and hennevogel committed Feb 4, 2016
1 parent f0194d4 commit c594fe5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/api/spec/support/features/features_authentification.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
module FeaturesAuthentification
def login(user, password = 'buildservice')
visit user_login_path
fill_in 'Username', with: user.login
fill_in 'Password', with: password
click_button 'Log In'
expect(page).to have_text "Please Log In"
fill_in 'user_login', with: user.login
fill_in 'user_password', with: password
click_button 'Log In »'
expect(page).to have_link 'link-to-user-home'
end

def logout
visit user_logout_path
expect(page).to have_no_link('link-to-user-home')
end
end

Expand Down

0 comments on commit c594fe5

Please sign in to comment.