Sha256: 1737f01c858605d830cd90dcd25e5e97e10dd0e52b4cb4622401f13109ef99de
Contents?: true
Size: 1.03 KB
Versions: 33
Compression:
Stored size: 1.03 KB
Contents
require "test_helper" class SessionsControllerTest < ActionDispatch::IntegrationTest setup do @user = users(:lazaro_nixon) end test "should get index" do sign_in_as @user get sessions_url assert_response :success end test "should get new" do get sign_in_url assert_response :success end test "should sign in" do post sign_in_url, params: { email: @user.email, password: "Secret1*3*5*" } assert_redirected_to root_url get root_url assert_response :success end test "should not sign in with wrong credentials" do post sign_in_url, params: { email: @user.email, password: "SecretWrong1*3" } assert_redirected_to sign_in_url(email_hint: @user.email) assert_equal "That email or password is incorrect", flash[:alert] get root_url assert_redirected_to sign_in_url end test "should sign out" do sign_in_as @user delete session_url(@user.sessions.last) assert_redirected_to sessions_url follow_redirect! assert_redirected_to sign_in_url end end
Version data entries
33 entries across 33 versions & 1 rubygems