Skip to content

Commit

Permalink
More user session tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
fredwu committed Jul 13, 2011
1 parent c63c055 commit cbb9ad3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions spec/requests/user_session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ def sign_in_user(login = user.email)
response.body.should include(user.name)
end

it "rejects signing in with incorrect login" do
sign_in_user('dummy')

response.body.should include('Invalid email or password.')
end

it "signs out" do
sign_in_user
get destroy_user_session_path
Expand All @@ -49,17 +55,13 @@ def sign_in_user(login = user.email)
end

it "sends user confirmation instructions" do
post user_confirmation_path, :user => {
:email => user_unconfirmed.email
}
post user_confirmation_path, :user => { :email => user_unconfirmed.email }

response.should redirect_to(new_user_session_path)
end

it "sends reset password instructions" do
post user_password_path, :user => {
:login => user.email
}
post user_password_path, :user => { :login => user.email }

response.should redirect_to(new_user_session_path)
end
Expand Down

0 comments on commit cbb9ad3

Please sign in to comment.