Sha256: 32e30a8ae5268d7113e1f0c2ecafe84712da6214f254099945f21ceb264b43f1

Contents?: true

Size: 680 Bytes

Versions: 9

Compression:

Stored size: 680 Bytes

Contents

require 'test_helper'

module Knock
  class AuthTokenControllerTest < ActionController::TestCase
    setup do
      @routes = Engine.routes
    end

    def user
      @user ||= users(:one)
    end

    test "responds with 404 if user does not exist" do
      post :create, auth: { email: 'wrong@example.net', password: '' }
      assert_response :not_found
    end

    test "responds with 404 if password is invalid" do
      post :create, auth: { email: user.email, password: 'wrong' }
      assert_response :not_found
    end

    test "responds with 201" do
      post :create, auth: { email: user.email, password: 'secret' }
      assert_response :created
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
knock-1.4.2 test/controllers/knock/auth_token_controller_test.rb
knock-1.4.1 test/controllers/knock/auth_token_controller_test.rb
knock-1.4.0 test/controllers/knock/auth_token_controller_test.rb
knock-1.3.0 test/controllers/knock/auth_token_controller_test.rb
knock-1.2.0 test/controllers/knock/auth_token_controller_test.rb
knock-1.1.0 test/controllers/knock/auth_token_controller_test.rb
knock-1.1.0.rc1 test/controllers/knock/auth_token_controller_test.rb
knock-1.0.0 test/controllers/knock/auth_token_controller_test.rb
knock-1.0.0.rc1 test/controllers/knock/auth_token_controller_test.rb