Sha256: aa2d71d20278dc155d6b6b55115a1c2881f7b81f14a2990e56e33a34dd64b985
Contents?: true
Size: 716 Bytes
Versions: 1
Compression:
Stored size: 716 Bytes
Contents
require 'test_helper' class CurrentUsersControllerTest < ActionController::TestCase setup do @user = users(:one) @token = KnockRails3::AuthToken.new(payload: { sub: @user.id }).token end def authenticate token: @token @request.env['HTTP_AUTHORIZATION'] = "Bearer #{token}" end test "responds with 404 if user is not logged in" do get :show assert_response :not_found end test "responds with 200" do authenticate get :show assert_response :success end # Run this test twice to validate that it still works # when the getter method has already been defined. test "responds with 200 #2" do authenticate get :show assert_response :success end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
KnockRails3-2.1.1 | test/dummy/test/controllers/current_users_controller_test.rb |