The first rails app I wrote used the hand-rolled authentication from railstutorial.
For my second app I'm using Clearance. I'm trying to write the integration tests for whether clicking the sign in/sign out links have worked. In the railstutorial version I can use the following:
describe "success" do
it "should sign a user in and out" do
user = Factory(:user)
visit signin_path
fill_in :email, :with => user.email
fill_in :password, :with => user.password
click_button
controller.should be_signed_in
click_link "Sign out"
controller.should_not be_signed_in
end
end
How do I do the equivalent thing with clearance? I just can't work it out. It seems to be telling me that controller is nil.