Sha256: 27ae214ddd2f6a2cc863f40a0f826951e52ecb683e089d6953776acc08843b3b
Contents?: true
Size: 1008 Bytes
Versions: 15
Compression:
Stored size: 1008 Bytes
Contents
require 'helper' class SessionsControllerTest < ActionController::TestCase tests SessionsController context "The sessions controller" do setup do @user = create(:user, :username => 'sessions-user-test') end should "have a sign-in page" do get :new assert_response :success end should "be able to sign in" do Challah::Session.any_instance.stubs(:save).returns(true) post :create, :username => 'sessions-user-test', :password => 'abc123' assert_redirected_to '/' Challah::Session.any_instance.unstub(:save) end should "send you back to the sign in page if you can't sign in" do Challah::Session.any_instance.stubs(:save).returns(false) post :create, :username => 'sessions-user-test', :password => 'abc123' assert_redirected_to '/sign-in' Challah::Session.any_instance.unstub(:save) end should "be able to sign out" do get :destroy assert_redirected_to '/sign-in' end end end
Version data entries
15 entries across 14 versions & 2 rubygems