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.
- data/.gitignore +0 -2
- data/CHANGELOG.rdoc +18 -7
- data/Gemfile.lock +168 -0
- data/README.rdoc +2 -0
- data/app/controllers/devise/registrations_controller.rb +6 -1
- data/app/controllers/devise/unlocks_controller.rb +1 -2
- data/app/views/devise/mailer/confirmation_instructions.html.erb +1 -1
- data/config/locales/en.yml +1 -0
- data/lib/devise.rb +41 -22
- data/lib/devise/controllers/internal_helpers.rb +9 -2
- data/lib/devise/models/authenticatable.rb +30 -12
- data/lib/devise/models/confirmable.rb +73 -18
- data/lib/devise/models/database_authenticatable.rb +0 -11
- data/lib/devise/models/recoverable.rb +5 -5
- data/lib/devise/models/rememberable.rb +5 -20
- data/lib/devise/models/timeoutable.rb +1 -3
- data/lib/devise/models/token_authenticatable.rb +1 -4
- data/lib/devise/models/validatable.rb +1 -1
- data/lib/devise/orm/active_record.rb +6 -0
- data/lib/devise/param_filter.rb +2 -1
- data/lib/devise/rails.rb +31 -0
- data/lib/devise/schema.rb +5 -0
- data/lib/devise/strategies/authenticatable.rb +12 -8
- data/lib/devise/strategies/token_authenticatable.rb +3 -3
- data/lib/devise/version.rb +1 -1
- data/lib/generators/active_record/devise_generator.rb +40 -2
- data/lib/generators/active_record/templates/migration.rb +1 -9
- data/lib/generators/active_record/templates/migration_existing.rb +1 -9
- data/lib/generators/mongoid/devise_generator.rb +43 -0
- data/lib/generators/templates/devise.rb +15 -9
- data/test/controllers/internal_helpers_test.rb +4 -2
- data/test/devise_test.rb +2 -2
- data/test/integration/confirmable_test.rb +55 -3
- data/test/integration/http_authenticatable_test.rb +16 -1
- data/test/integration/lockable_test.rb +3 -3
- data/test/integration/registerable_test.rb +32 -1
- data/test/integration/rememberable_test.rb +0 -50
- data/test/integration/token_authenticatable_test.rb +2 -2
- data/test/integration/trackable_test.rb +1 -1
- data/test/mapping_test.rb +2 -3
- data/test/models/confirmable_test.rb +86 -8
- data/test/models/database_authenticatable_test.rb +6 -6
- data/test/models/encryptable_test.rb +1 -1
- data/test/models/recoverable_test.rb +0 -27
- data/test/models/rememberable_test.rb +41 -160
- data/test/models/serializable_test.rb +1 -1
- data/test/models_test.rb +7 -7
- data/test/rails_app/app/mongoid/admin.rb +22 -1
- data/test/rails_app/app/mongoid/user.rb +35 -0
- data/test/rails_app/config/initializers/devise.rb +6 -7
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +58 -12
- data/test/rails_app/lib/shared_admin.rb +5 -2
- data/test/support/assertions.rb +4 -1
- data/test/support/integration.rb +3 -1
- data/test/test_helpers_test.rb +2 -2
- metadata +21 -39
- data/test/models/authenticatable_test.rb +0 -9
- data/test/schema_test.rb +0 -33
data/test/schema_test.rb
DELETED
@@ -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
|