Saturday, 10 August 2013

test that user still connected permanently after checking remember me checkbox

test that user still connected permanently after checking remember me
checkbox

I'm trying to test the login form with rspec and capybara that if the user
check the remember me checkbox then he closes the browser and reopen it
again, he still connected, here what my test look likes :
it "still connected if remember me is checked" do
user = FactoryGirl.create(:user)
fill_in "Email", with: user.email
fill_in "Password", with: user.password
check "Remember me"
click_button submit
page.should have_link("sign out", signout_path)
# here i should do something to close the browser
visit signin_path
page.should have_link("Sign out", signout_path)
end
I'm searching how can i close the browser with capybara but any solution
works for me, there is a simple way to do this ?

No comments:

Post a Comment