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.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +8 -7
  4. data/lib/authentication_zero/version.rb +1 -1
  5. data/lib/generators/authentication/authentication_generator.rb +7 -6
  6. data/lib/generators/authentication/templates/controllers/api/email_verifications_controller.rb.tt +18 -0
  7. data/lib/generators/authentication/templates/controllers/api/password_resets_controller.rb.tt +6 -6
  8. data/lib/generators/authentication/templates/controllers/api/registrations_controller.rb.tt +5 -1
  9. data/lib/generators/authentication/templates/controllers/api/sessions_controller.rb.tt +4 -4
  10. data/lib/generators/authentication/templates/controllers/html/email_verifications_controller.rb.tt +20 -0
  11. data/lib/generators/authentication/templates/controllers/html/emails_controller.rb.tt +2 -2
  12. data/lib/generators/authentication/templates/controllers/html/password_resets_controller.rb.tt +7 -7
  13. data/lib/generators/authentication/templates/controllers/html/passwords_controller.rb.tt +2 -2
  14. data/lib/generators/authentication/templates/controllers/html/registrations_controller.rb.tt +7 -9
  15. data/lib/generators/authentication/templates/controllers/html/sessions_controller.rb.tt +4 -4
  16. data/lib/generators/authentication/templates/erb/emails/edit.html.erb.tt +8 -2
  17. data/lib/generators/authentication/templates/erb/identity_mailer/email_verify_confirmation.html.erb.tt +11 -0
  18. data/lib/generators/authentication/templates/erb/identity_mailer/email_verify_confirmation.text.erb.tt +9 -0
  19. data/lib/generators/authentication/templates/erb/{password_mailer/reset.html.erb.tt → identity_mailer/password_reset_provision.html.erb.tt} +2 -2
  20. data/lib/generators/authentication/templates/erb/{password_mailer/reset.text.erb.tt → identity_mailer/password_reset_provision.text.erb.tt} +2 -2
  21. data/lib/generators/authentication/templates/erb/password_resets/edit.html.erb.tt +1 -1
  22. data/lib/generators/authentication/templates/erb/password_resets/new.html.erb.tt +1 -1
  23. data/lib/generators/authentication/templates/erb/passwords/edit.html.erb.tt +1 -1
  24. data/lib/generators/authentication/templates/erb/session_mailer/signed_in_notification.html.erb.tt +21 -0
  25. data/lib/generators/authentication/templates/erb/session_mailer/signed_in_notification.text.erb.tt +17 -0
  26. data/lib/generators/authentication/templates/erb/sessions/new.html.erb.tt +1 -1
  27. data/lib/generators/authentication/templates/mailers/identity_mailer.rb.tt +15 -0
  28. data/lib/generators/authentication/templates/mailers/session_mailer.rb.tt +6 -0
  29. data/lib/generators/authentication/templates/migrations/create_sessions_migration.rb.tt +1 -0
  30. data/lib/generators/authentication/templates/migrations/create_table_migration.rb.tt +2 -0
  31. data/lib/generators/authentication/templates/models/current.rb.tt +1 -1
  32. data/lib/generators/authentication/templates/models/model.rb.tt +8 -8
  33. data/lib/generators/authentication/templates/models/session.rb.tt +4 -0
  34. data/lib/generators/authentication/templates/test_unit/controllers/api/email_verifications_controller_test.rb.tt +36 -0
  35. data/lib/generators/authentication/templates/test_unit/controllers/api/emails_controller_test.rb.tt +2 -7
  36. data/lib/generators/authentication/templates/test_unit/controllers/api/password_resets_controller_test.rb.tt +18 -7
  37. data/lib/generators/authentication/templates/test_unit/controllers/api/passwords_controller_test.rb.tt +2 -7
  38. data/lib/generators/authentication/templates/test_unit/controllers/api/registrations_controller_test.rb.tt +15 -0
  39. data/lib/generators/authentication/templates/test_unit/controllers/api/sessions_controller_test.rb.tt +2 -0
  40. data/lib/generators/authentication/templates/test_unit/controllers/html/email_verifications_controller_test.rb.tt +35 -0
  41. data/lib/generators/authentication/templates/test_unit/controllers/html/emails_controller_test.rb.tt +5 -10
  42. data/lib/generators/authentication/templates/test_unit/controllers/html/password_resets_controller_test.rb.tt +22 -11
  43. data/lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt +5 -10
  44. data/lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt +15 -3
  45. data/lib/generators/authentication/templates/test_unit/controllers/html/sessions_controller_test.rb.tt +4 -2
  46. data/lib/generators/authentication/templates/test_unit/fixtures.yml.tt +1 -0
  47. data/lib/generators/authentication/templates/test_unit/sessions.yml.tt +1 -1
  48. data/lib/generators/authentication/templates/test_unit/system/emails_test.rb.tt +11 -2
  49. data/lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt +2 -2
  50. data/lib/generators/authentication/templates/test_unit/system/passwords_test.rb.tt +2 -2
  51. data/lib/generators/authentication/templates/test_unit/system/registrations_test.rb.tt +20 -0
  52. metadata +14 -16
  53. data/lib/generators/authentication/templates/controllers/api/cancellations_controller.rb.tt +0 -5
  54. data/lib/generators/authentication/templates/controllers/html/cancellations_controller.rb.tt +0 -9
  55. data/lib/generators/authentication/templates/erb/cancellations/new.html.erb.tt +0 -11
  56. data/lib/generators/authentication/templates/erb/email_mailer/changed.html.erb.tt +0 -11
  57. data/lib/generators/authentication/templates/erb/email_mailer/changed.text.erb.tt +0 -9
  58. data/lib/generators/authentication/templates/erb/password_mailer/changed.html.erb.tt +0 -7
  59. data/lib/generators/authentication/templates/erb/password_mailer/changed.text.erb.tt +0 -5
  60. data/lib/generators/authentication/templates/mailers/email_mailer.rb.tt +0 -6
  61. data/lib/generators/authentication/templates/mailers/password_mailer.rb.tt +0 -10
  62. data/lib/generators/authentication/templates/test_unit/controllers/api/cancellations_controller_test.rb.tt +0 -20
  63. data/lib/generators/authentication/templates/test_unit/controllers/html/cancellations_controller_test.rb.tt +0 -24
  64. 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