Sha256: 82f7ccf196ad684ffa198a933f726408fe13fe6efddc028145be76749d4f5746

Contents?: true

Size: 873 Bytes

Versions: 4

Compression:

Stored size: 873 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: "Secret123456", password_confirmation: "Secret123456" } }
    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: "Secret123456" }); <%= singular_table_name %>
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
authentication-zero-2.3.2 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.3.1 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.3.0 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
authentication-zero-2.2.10 lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt