devise 1.5.4 → 2.0.0.rc

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

Potentially problematic release.


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

Files changed (58) hide show
  1. data/.gitignore +0 -2
  2. data/CHANGELOG.rdoc +18 -7
  3. data/Gemfile.lock +168 -0
  4. data/README.rdoc +2 -0
  5. data/app/controllers/devise/registrations_controller.rb +6 -1
  6. data/app/controllers/devise/unlocks_controller.rb +1 -2
  7. data/app/views/devise/mailer/confirmation_instructions.html.erb +1 -1
  8. data/config/locales/en.yml +1 -0
  9. data/lib/devise.rb +41 -22
  10. data/lib/devise/controllers/internal_helpers.rb +9 -2
  11. data/lib/devise/models/authenticatable.rb +30 -12
  12. data/lib/devise/models/confirmable.rb +73 -18
  13. data/lib/devise/models/database_authenticatable.rb +0 -11
  14. data/lib/devise/models/recoverable.rb +5 -5
  15. data/lib/devise/models/rememberable.rb +5 -20
  16. data/lib/devise/models/timeoutable.rb +1 -3
  17. data/lib/devise/models/token_authenticatable.rb +1 -4
  18. data/lib/devise/models/validatable.rb +1 -1
  19. data/lib/devise/orm/active_record.rb +6 -0
  20. data/lib/devise/param_filter.rb +2 -1
  21. data/lib/devise/rails.rb +31 -0
  22. data/lib/devise/schema.rb +5 -0
  23. data/lib/devise/strategies/authenticatable.rb +12 -8
  24. data/lib/devise/strategies/token_authenticatable.rb +3 -3
  25. data/lib/devise/version.rb +1 -1
  26. data/lib/generators/active_record/devise_generator.rb +40 -2
  27. data/lib/generators/active_record/templates/migration.rb +1 -9
  28. data/lib/generators/active_record/templates/migration_existing.rb +1 -9
  29. data/lib/generators/mongoid/devise_generator.rb +43 -0
  30. data/lib/generators/templates/devise.rb +15 -9
  31. data/test/controllers/internal_helpers_test.rb +4 -2
  32. data/test/devise_test.rb +2 -2
  33. data/test/integration/confirmable_test.rb +55 -3
  34. data/test/integration/http_authenticatable_test.rb +16 -1
  35. data/test/integration/lockable_test.rb +3 -3
  36. data/test/integration/registerable_test.rb +32 -1
  37. data/test/integration/rememberable_test.rb +0 -50
  38. data/test/integration/token_authenticatable_test.rb +2 -2
  39. data/test/integration/trackable_test.rb +1 -1
  40. data/test/mapping_test.rb +2 -3
  41. data/test/models/confirmable_test.rb +86 -8
  42. data/test/models/database_authenticatable_test.rb +6 -6
  43. data/test/models/encryptable_test.rb +1 -1
  44. data/test/models/recoverable_test.rb +0 -27
  45. data/test/models/rememberable_test.rb +41 -160
  46. data/test/models/serializable_test.rb +1 -1
  47. data/test/models_test.rb +7 -7
  48. data/test/rails_app/app/mongoid/admin.rb +22 -1
  49. data/test/rails_app/app/mongoid/user.rb +35 -0
  50. data/test/rails_app/config/initializers/devise.rb +6 -7
  51. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +58 -12
  52. data/test/rails_app/lib/shared_admin.rb +5 -2
  53. data/test/support/assertions.rb +4 -1
  54. data/test/support/integration.rb +3 -1
  55. data/test/test_helpers_test.rb +2 -2
  56. metadata +21 -39
  57. data/test/models/authenticatable_test.rb +0 -9
  58. data/test/schema_test.rb +0 -33
@@ -1,33 +0,0 @@
1
- if DEVISE_ORM == :mongoid
2
-
3
- require 'test_helper'
4
-
5
- class User2
6
- include Mongoid::Document
7
- devise :database_authenticatable
8
- end
9
-
10
- class User3
11
- include Mongoid::Document
12
- devise :database_authenticatable, :authentication_keys => [:username, :email]
13
- end
14
-
15
- class User4
16
- include Mongoid::Document
17
- devise :database_authenticatable, :authentication_keys => [:username]
18
- end
19
-
20
- class SchemaTest < ActiveSupport::TestCase
21
- test 'should create an email field if there are no custom authentication keys' do
22
- assert_not_equal User2.fields['email'], nil
23
- end
24
-
25
- test 'should create an email field if there are custom authentication keys and they include email' do
26
- assert_not_equal User3.fields['email'], nil
27
- end
28
-
29
- test 'should not create an email field if there are custom authentication keys they don\'t include email' do
30
- assert_equal User4.fields['email'], nil
31
- end
32
- end
33
- end