Sha256: fe045505462acac4daa956ff4e1ad6214603baada7241ca47d6a64d936b696cf

Contents?: true

Size: 864 Bytes

Versions: 7

Compression:

Stored size: 864 Bytes

Contents

require "test_helper"

class RegistrationsControllerTest < ActionDispatch::IntegrationTest
  test "should get new" do
    get sign_up_url
    assert_response :success
  end

  test "should sign up" do
    assert_difference("<%= class_name %>.count") do
      post sign_up_url, params: { <%= singular_table_name %>: { email: "lazaronixon@hey.com", password: "secret123", password_confirmation: "secret123" } }
    end

    assert_redirected_to root_url
  end

  test "should destroy account" do
    sign_in_as <%= table_name %>(:lazaro_nixon)

    assert_difference("<%= class_name %>.count", -1) do
      delete registration_path
    end

    assert_redirected_to sign_in_url
  end

  def sign_in_as(<%= singular_table_name %>)
    post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "secret123" }); <%= singular_table_name %>
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
authentication-zero-2.2.8 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.2.7 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.2.6 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.2.5 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.2.4 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.2.3 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.2.2 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt