Sha256: cd3c4f57b105d4366032c8d09a3cb73c6e40b65d934eff97122f7ebaac0f72c0

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

require 'test_helper'

class VendorTokenControllerTest < ActionController::TestCase
  def setup
    @vendor = vendors(:one)
  end

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

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

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

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
KnockRails3-2.1.1 test/dummy/test/controllers/vendor_token_controller_test.rb
knock-2.1.1 test/dummy/test/controllers/vendor_token_controller_test.rb
knock-2.1 test/dummy/test/controllers/vendor_token_controller_test.rb
knock-2.0 test/dummy/test/controllers/vendor_token_controller_test.rb