Sha256: 84265a3f21bb203e46f9b66ced0c3bad3e1cd8f10c4df61c6916d0665d586e5c

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

require "test_helper"

class CancellationsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @<%= singular_table_name %>, @token = sign_in_as(<%= table_name %>(:lazaro_nixon))
  end

  test "should create cancellation" do
    assert_difference("<%= class_name %>.count", -1) do
      post cancellations_url, headers: { "Authorization" => "Bearer #{@token}" }
    end

    assert_response :no_content
  end

  def sign_in_as(<%= singular_table_name %>)
    post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "secret123" })
    [<%= singular_table_name %>, response.parsed_body["session_token"]]
  end  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
authentication-zero-1.0.2 lib/generators/authentication/templates/test_unit/controllers/api/cancellations_controller_test.rb.tt
authentication-zero-1.0.1 lib/generators/authentication/templates/test_unit/controllers/api/cancellations_controller_test.rb.tt
authentication-zero-1.0.0 lib/generators/authentication/templates/test_unit/controllers/api/cancellations_controller_test.rb.tt
authentication-zero-0.0.24 lib/generators/authentication/templates/test_unit/controllers/api/cancellations_controller_test.rb.tt
authentication-zero-0.0.23 lib/generators/authentication/templates/test_unit/controllers/api/cancellations_controller_test.rb.tt