authentication-zero 2.0.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +8 -7
- data/lib/authentication_zero/version.rb +1 -1
- data/lib/generators/authentication/authentication_generator.rb +7 -6
- data/lib/generators/authentication/templates/controllers/api/email_verifications_controller.rb.tt +18 -0
- data/lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt +6 -6
- data/lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt +5 -1
- data/lib/generators/authentication/templates/controllers/api/sessions_controller.rb.tt +4 -4
- data/lib/generators/authentication/templates/controllers/html/email_verifications_controller.rb.tt +20 -0
- data/lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt +2 -2
- data/lib/generators/authentication/templates/controllers/html/password_resets_controller.rb.tt +7 -7
- data/lib/generators/authentication/templates/controllers/html/passwords_controller.rb.tt +2 -2
- data/lib/generators/authentication/templates/controllers/html/registrations_controller.rb.tt +7 -9
- data/lib/generators/authentication/templates/controllers/html/sessions_controller.rb.tt +4 -4
- data/lib/generators/authentication/templates/erb/emails/edit.html.erb.tt +8 -2
- data/lib/generators/authentication/templates/erb/identity_mailer/email_verify_confirmation.html.erb.tt +11 -0
- data/lib/generators/authentication/templates/erb/identity_mailer/email_verify_confirmation.text.erb.tt +9 -0
- data/lib/generators/authentication/templates/erb/{password_mailer/reset.html.erb.tt → identity_mailer/password_reset_provision.html.erb.tt} +2 -2
- data/lib/generators/authentication/templates/erb/{password_mailer/reset.text.erb.tt → identity_mailer/password_reset_provision.text.erb.tt} +2 -2
- data/lib/generators/authentication/templates/erb/password_resets/edit.html.erb.tt +1 -1
- data/lib/generators/authentication/templates/erb/password_resets/new.html.erb.tt +1 -1
- data/lib/generators/authentication/templates/erb/passwords/edit.html.erb.tt +1 -1
- data/lib/generators/authentication/templates/erb/session_mailer/signed_in_notification.html.erb.tt +21 -0
- data/lib/generators/authentication/templates/erb/session_mailer/signed_in_notification.text.erb.tt +17 -0
- data/lib/generators/authentication/templates/erb/sessions/new.html.erb.tt +1 -1
- data/lib/generators/authentication/templates/mailers/identity_mailer.rb.tt +15 -0
- data/lib/generators/authentication/templates/mailers/session_mailer.rb.tt +6 -0
- data/lib/generators/authentication/templates/migrations/create_sessions_migration.rb.tt +1 -0
- data/lib/generators/authentication/templates/migrations/create_table_migration.rb.tt +2 -0
- data/lib/generators/authentication/templates/models/current.rb.tt +1 -1
- data/lib/generators/authentication/templates/models/model.rb.tt +8 -8
- data/lib/generators/authentication/templates/models/session.rb.tt +4 -0
- data/lib/generators/authentication/templates/test_unit/controllers/api/email_verifications_controller_test.rb.tt +36 -0
- data/lib/generators/authentication/templates/test_unit/controllers/api/emails_controller_test.rb.tt +2 -7
- data/lib/generators/authentication/templates/test_unit/controllers/api/password_resets_controller_test.rb.tt +18 -7
- data/lib/generators/authentication/templates/test_unit/controllers/api/passwords_controller_test.rb.tt +2 -7
- data/lib/generators/authentication/templates/test_unit/controllers/api/registrations_controller_test.rb.tt +15 -0
- data/lib/generators/authentication/templates/test_unit/controllers/api/sessions_controller_test.rb.tt +2 -0
- data/lib/generators/authentication/templates/test_unit/controllers/html/email_verifications_controller_test.rb.tt +35 -0
- data/lib/generators/authentication/templates/test_unit/controllers/html/emails_controller_test.rb.tt +5 -10
- data/lib/generators/authentication/templates/test_unit/controllers/html/password_resets_controller_test.rb.tt +22 -11
- data/lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt +5 -10
- data/lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt +15 -3
- data/lib/generators/authentication/templates/test_unit/controllers/html/sessions_controller_test.rb.tt +4 -2
- data/lib/generators/authentication/templates/test_unit/fixtures.yml.tt +1 -0
- data/lib/generators/authentication/templates/test_unit/sessions.yml.tt +1 -1
- data/lib/generators/authentication/templates/test_unit/system/emails_test.rb.tt +11 -2
- data/lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt +2 -2
- data/lib/generators/authentication/templates/test_unit/system/passwords_test.rb.tt +2 -2
- data/lib/generators/authentication/templates/test_unit/system/registrations_test.rb.tt +20 -0
- metadata +14 -16
- data/lib/generators/authentication/templates/controllers/api/cancellations_controller.rb.tt +0 -5
- data/lib/generators/authentication/templates/controllers/html/cancellations_controller.rb.tt +0 -9
- data/lib/generators/authentication/templates/erb/cancellations/new.html.erb.tt +0 -11
- data/lib/generators/authentication/templates/erb/email_mailer/changed.html.erb.tt +0 -11
- data/lib/generators/authentication/templates/erb/email_mailer/changed.text.erb.tt +0 -9
- data/lib/generators/authentication/templates/erb/password_mailer/changed.html.erb.tt +0 -7
- data/lib/generators/authentication/templates/erb/password_mailer/changed.text.erb.tt +0 -5
- data/lib/generators/authentication/templates/mailers/email_mailer.rb.tt +0 -6
- data/lib/generators/authentication/templates/mailers/password_mailer.rb.tt +0 -10
- data/lib/generators/authentication/templates/test_unit/controllers/api/cancellations_controller_test.rb.tt +0 -20
- data/lib/generators/authentication/templates/test_unit/controllers/html/cancellations_controller_test.rb.tt +0 -24
- data/lib/generators/authentication/templates/test_unit/system/cancellations_test.rb.tt +0 -23
@@ -1,20 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
class CancellationsControllerTest < ActionDispatch::IntegrationTest
|
4
|
-
setup do
|
5
|
-
@<%= singular_table_name %>, @token = sign_in_as(<%= table_name %>(:lazaro_nixon))
|
6
|
-
end
|
7
|
-
|
8
|
-
test "should create cancellation" do
|
9
|
-
assert_difference("<%= class_name %>.count", -1) do
|
10
|
-
post cancellations_url, headers: { "Authorization" => "Bearer #{@token}" }
|
11
|
-
end
|
12
|
-
|
13
|
-
assert_response :no_content
|
14
|
-
end
|
15
|
-
|
16
|
-
def sign_in_as(<%= singular_table_name %>)
|
17
|
-
post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "secret123" })
|
18
|
-
[<%= singular_table_name %>, response.headers["X-Session-Token"]]
|
19
|
-
end
|
20
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require "test_helper"
|
2
|
-
|
3
|
-
class CancellationsControllerTest < ActionDispatch::IntegrationTest
|
4
|
-
setup do
|
5
|
-
@<%= singular_table_name %> = sign_in_as(<%= table_name %>(:lazaro_nixon))
|
6
|
-
end
|
7
|
-
|
8
|
-
test "should get new" do
|
9
|
-
get new_cancellations_url
|
10
|
-
assert_response :success
|
11
|
-
end
|
12
|
-
|
13
|
-
test "should create cancellation" do
|
14
|
-
assert_difference("<%= class_name %>.count", -1) do
|
15
|
-
post cancellations_url
|
16
|
-
end
|
17
|
-
|
18
|
-
assert_redirected_to sign_in_url
|
19
|
-
end
|
20
|
-
|
21
|
-
def sign_in_as(<%= singular_table_name %>)
|
22
|
-
post(sign_in_url, params: { email: <%= singular_table_name %>.email, password: "secret123" }); user
|
23
|
-
end
|
24
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require "application_system_test_case"
|
2
|
-
|
3
|
-
class CancellationsTest < ApplicationSystemTestCase
|
4
|
-
setup do
|
5
|
-
@<%= singular_table_name %> = sign_in_as(<%= table_name %>(:lazaro_nixon))
|
6
|
-
end
|
7
|
-
|
8
|
-
test "cancelling my account" do
|
9
|
-
click_on "Cancel my account & delete my data"
|
10
|
-
click_on "OK, close my account"
|
11
|
-
|
12
|
-
assert_text "Bye! Your account has been successfully cancelled"
|
13
|
-
end
|
14
|
-
|
15
|
-
def sign_in_as(<%= singular_table_name %>)
|
16
|
-
visit sign_in_url
|
17
|
-
fill_in :email, with: <%= singular_table_name %>.email
|
18
|
-
fill_in :password, with: "secret123"
|
19
|
-
click_on "Sign in"
|
20
|
-
|
21
|
-
return <%= singular_table_name %>
|
22
|
-
end
|
23
|
-
end
|