Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Use warden helpers rather than capybara walking through signing in fo…
Browse files Browse the repository at this point in the history
…r sign_in
  • Loading branch information
radar committed Jun 18, 2012
1 parent b9f9b82 commit 2fa055c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions spec/support/sign_in_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
module SignInHelpers
def sign_in(user)
visit '/users/sign_in'
fill_in 'Email', :with => user.email
fill_in 'Password', :with => 'password'
click_button 'Sign in'
page.should have_content("Signed in successfully")
login_as(user)
# visit '/users/sign_in'
# fill_in 'Email', :with => user.email
# fill_in 'Password', :with => 'password'
# click_button 'Sign in'
# page.should have_content("Signed in successfully")
end

def sign_out
click_link 'Sign out'
page.should have_content("Signed out successfully")
logout
end
end

RSpec.configure do |c|
c.include Warden::Test::Helpers
c.include SignInHelpers, :type => :request
end

0 comments on commit 2fa055c

Please sign in to comment.