Skip to content

Instantly share code, notes, and snippets.

@bricker
Created July 4, 2014 01:30
Show Gist options
  • Select an option

  • Save bricker/e97f4eafa8e5fd95e774 to your computer and use it in GitHub Desktop.

Select an option

Save bricker/e97f4eafa8e5fd95e774 to your computer and use it in GitHub Desktop.
describe SessionsController do
it "allows login with username" do
user = User.create(username: "bricker", password: "test", password_confirmation: "test")
post :create, username: "bricker", password: "test"
controller.session[:user_id].should eq user.id
end
# same for e-mail
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment