clearance 1.0.0.rc2 → 1.0.0.rc3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of clearance might be problematic. Click here for more details.

Files changed (50) hide show
  1. data/Gemfile.lock +2 -5
  2. data/NEWS.md +4 -1
  3. data/README.md +10 -10
  4. data/Rakefile +0 -1
  5. data/app/controllers/clearance/passwords_controller.rb +1 -10
  6. data/clearance.gemspec +0 -1
  7. data/features/add_migrations_to_project.feature +65 -0
  8. data/features/integration_with_rspec.feature +21 -0
  9. data/features/step_definitions/configuration_steps.rb +21 -0
  10. data/features/step_definitions/gem_file_steps.rb +7 -0
  11. data/features/support/env.rb +8 -18
  12. data/gemfiles/3.0.17.gemfile.lock +1 -4
  13. data/gemfiles/3.1.8.gemfile.lock +1 -4
  14. data/gemfiles/3.2.8.gemfile.lock +1 -4
  15. data/{features/support/clearance.rb → lib/clearance/testing/app/controllers/application_controller.rb} +0 -9
  16. data/lib/clearance/testing/application.rb +46 -0
  17. data/lib/clearance/testing/config/database.yml +11 -0
  18. data/lib/clearance/testing/config/routes.rb +3 -0
  19. data/lib/clearance/version.rb +1 -1
  20. data/lib/generators/clearance/install/install_generator.rb +103 -22
  21. data/lib/generators/clearance/install/templates/README +14 -7
  22. data/lib/generators/clearance/install/templates/db/migrate/add_clearance_to_users.rb +21 -0
  23. data/lib/generators/clearance/install/templates/db/migrate/create_users.rb +18 -0
  24. data/lib/generators/clearance/specs/USAGE +5 -0
  25. data/lib/generators/clearance/specs/specs_generator.rb +13 -0
  26. data/lib/generators/clearance/specs/templates/factories/clearance.rb +10 -0
  27. data/lib/generators/clearance/specs/templates/integration/clearance/user_signs_out_spec.rb +10 -0
  28. data/lib/generators/clearance/specs/templates/integration/clearance/visitor_resets_password_spec.rb +28 -0
  29. data/lib/generators/clearance/specs/templates/integration/clearance/visitor_signs_in_spec.rb +42 -0
  30. data/lib/generators/clearance/specs/templates/integration/clearance/visitor_signs_up_spec.rb +21 -0
  31. data/lib/generators/clearance/specs/templates/integration/clearance/visitor_updates_password_spec.rb +47 -0
  32. data/lib/generators/clearance/specs/templates/support/action_mailer.rb +3 -0
  33. data/lib/generators/clearance/specs/templates/support/clearance.rb +1 -0
  34. data/lib/generators/clearance/specs/templates/support/factory_girl.rb +5 -0
  35. data/lib/generators/clearance/specs/templates/support/integration.rb +4 -0
  36. data/lib/generators/clearance/specs/templates/support/integration/action_mailer_helpers.rb +19 -0
  37. data/lib/generators/clearance/specs/templates/support/integration/clearance_helpers.rb +49 -0
  38. data/lib/generators/clearance/views/USAGE +15 -0
  39. data/lib/generators/clearance/views/views_generator.rb +23 -2
  40. data/spec/controllers/passwords_controller_spec.rb +1 -2
  41. data/spec/spec_helper.rb +5 -3
  42. metadata +30 -35
  43. data/features/engine/visitor_resets_password.feature +0 -34
  44. data/features/engine/visitor_signs_in.feature +0 -33
  45. data/features/engine/visitor_signs_out.feature +0 -12
  46. data/features/engine/visitor_signs_up.feature +0 -17
  47. data/features/integration.feature +0 -50
  48. data/features/step_definitions/engine/clearance_steps.rb +0 -124
  49. data/lib/generators/clearance/features/features_generator.rb +0 -8
  50. data/lib/generators/clearance/install/templates/db/migrate/upgrade_clearance_to_diesel.rb +0 -37
@@ -1,8 +0,0 @@
1
- require 'diesel/generators/features_base'
2
-
3
- module Clearance
4
- module Generators
5
- class FeaturesGenerator < Diesel::Generators::FeaturesBase
6
- end
7
- end
8
- end
@@ -1,37 +0,0 @@
1
- <%
2
- existing_columns = ActiveRecord::Base.connection.columns(:users).map(&:name)
3
- new_columns = {
4
- :email => 't.string :email',
5
- :encrypted_password => 't.string :encrypted_password, :limit => 128',
6
- :confirmation_token => 't.string :confirmation_token, :limit => 128',
7
- :remember_token => 't.string :remember_token, :limit => 128'
8
- }.reject { |column| existing_columns.include?(column.to_s) }
9
- -%>
10
- <%
11
- existing_indexes = ActiveRecord::Base.connection.indexes(:users).map(&:name)
12
- new_indexes = {
13
- :index_users_on_email => 'add_index :users, :email',
14
- :index_users_on_remember_token => 'add_index :users, :remember_token'
15
- }.reject { |index| existing_indexes.include?(index.to_s) }
16
- -%>
17
- class UpgradeClearanceToDiesel < ActiveRecord::Migration
18
- def self.up
19
- change_table :users do |t|
20
- <% new_columns.values.each do |column| -%>
21
- <%= column %>
22
- <% end -%>
23
- end
24
-
25
- <% new_indexes.values.each do |index| -%>
26
- <%= index %>
27
- <% end -%>
28
- end
29
-
30
- def self.down
31
- change_table :users do |t|
32
- <% if new_columns.any? -%>
33
- t.remove <%= new_columns.keys.map { |column| ":#{column}" }.join(',') %>
34
- <% end -%>
35
- end
36
- end
37
- end