devise 4.4.3 → 4.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +174 -4
- data/MIT-LICENSE +2 -1
- data/README.md +129 -65
- data/app/controllers/devise/confirmations_controller.rb +1 -0
- data/app/controllers/devise/passwords_controller.rb +3 -2
- data/app/controllers/devise/registrations_controller.rb +27 -9
- data/app/controllers/devise/sessions_controller.rb +2 -2
- data/app/controllers/devise/unlocks_controller.rb +1 -0
- data/app/controllers/devise_controller.rb +17 -3
- data/app/helpers/devise_helper.rb +21 -18
- data/app/mailers/devise/mailer.rb +5 -5
- data/app/views/devise/confirmations/new.html.erb +1 -1
- data/app/views/devise/passwords/edit.html.erb +3 -3
- data/app/views/devise/passwords/new.html.erb +1 -1
- data/app/views/devise/registrations/edit.html.erb +5 -5
- data/app/views/devise/registrations/new.html.erb +3 -3
- data/app/views/devise/sessions/new.html.erb +3 -3
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.erb +8 -8
- data/app/views/devise/unlocks/new.html.erb +1 -1
- data/config/locales/en.yml +3 -2
- data/lib/devise/controllers/helpers.rb +10 -8
- data/lib/devise/controllers/responder.rb +35 -0
- data/lib/devise/controllers/sign_in_out.rb +9 -4
- data/lib/devise/controllers/url_helpers.rb +1 -1
- data/lib/devise/failure_app.rb +41 -8
- data/lib/devise/hooks/csrf_cleaner.rb +6 -1
- data/lib/devise/hooks/lockable.rb +2 -5
- data/lib/devise/hooks/timeoutable.rb +2 -2
- data/lib/devise/mapping.rb +1 -1
- data/lib/devise/models/authenticatable.rb +51 -48
- data/lib/devise/models/confirmable.rb +34 -40
- data/lib/devise/models/database_authenticatable.rb +54 -35
- data/lib/devise/models/lockable.rb +13 -5
- data/lib/devise/models/omniauthable.rb +2 -2
- data/lib/devise/models/recoverable.rb +8 -19
- data/lib/devise/models/registerable.rb +2 -0
- data/lib/devise/models/rememberable.rb +2 -2
- data/lib/devise/models/timeoutable.rb +1 -1
- data/lib/devise/models/trackable.rb +9 -2
- data/lib/devise/models/validatable.rb +4 -9
- data/lib/devise/models.rb +1 -0
- data/lib/devise/omniauth.rb +2 -5
- data/lib/devise/orm.rb +71 -0
- data/lib/devise/parameter_filter.rb +2 -0
- data/lib/devise/parameter_sanitizer.rb +13 -1
- data/lib/devise/rails/deprecated_constant_accessor.rb +39 -0
- data/lib/devise/rails/routes.rb +6 -6
- data/lib/devise/rails.rb +4 -0
- data/lib/devise/secret_key_finder.rb +2 -0
- data/lib/devise/strategies/authenticatable.rb +1 -1
- data/lib/devise/strategies/database_authenticatable.rb +6 -1
- data/lib/devise/test/controller_helpers.rb +5 -3
- data/lib/devise/test/integration_helpers.rb +1 -1
- data/lib/devise/test_helpers.rb +1 -1
- data/lib/devise/version.rb +1 -1
- data/lib/devise.rb +38 -11
- data/lib/generators/active_record/devise_generator.rb +26 -11
- data/lib/generators/devise/controllers_generator.rb +1 -1
- data/lib/generators/devise/devise_generator.rb +1 -1
- data/lib/generators/devise/install_generator.rb +1 -5
- data/lib/generators/devise/orm_helpers.rb +2 -2
- data/lib/generators/devise/views_generator.rb +1 -1
- data/lib/generators/mongoid/devise_generator.rb +5 -5
- data/lib/generators/templates/README +9 -1
- data/lib/generators/templates/controllers/omniauth_callbacks_controller.rb +1 -1
- data/lib/generators/templates/devise.rb +38 -8
- data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +5 -1
- data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +10 -2
- data/lib/generators/templates/simple_form_for/passwords/new.html.erb +4 -1
- data/lib/generators/templates/simple_form_for/registrations/edit.html.erb +12 -4
- data/lib/generators/templates/simple_form_for/registrations/new.html.erb +11 -3
- data/lib/generators/templates/simple_form_for/sessions/new.html.erb +7 -2
- data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +4 -1
- metadata +23 -316
- data/.gitignore +0 -10
- data/.travis.yml +0 -68
- data/.yardopts +0 -9
- data/CODE_OF_CONDUCT.md +0 -22
- data/CONTRIBUTING.md +0 -79
- data/Gemfile +0 -39
- data/Gemfile.lock +0 -193
- data/ISSUE_TEMPLATE.md +0 -19
- data/Rakefile +0 -37
- data/bin/test +0 -13
- data/devise.gemspec +0 -28
- data/devise.png +0 -0
- data/gemfiles/Gemfile.rails-4.1-stable +0 -32
- data/gemfiles/Gemfile.rails-4.1-stable.lock +0 -171
- data/gemfiles/Gemfile.rails-4.2-stable +0 -32
- data/gemfiles/Gemfile.rails-4.2-stable.lock +0 -192
- data/gemfiles/Gemfile.rails-5.0-stable +0 -33
- data/gemfiles/Gemfile.rails-5.0-stable.lock +0 -192
- data/gemfiles/Gemfile.rails-5.2-rc1 +0 -26
- data/gemfiles/Gemfile.rails-5.2-rc1.lock +0 -201
- data/guides/bug_report_templates/integration_test.rb +0 -106
- data/test/controllers/custom_registrations_controller_test.rb +0 -42
- data/test/controllers/custom_strategy_test.rb +0 -66
- data/test/controllers/helper_methods_test.rb +0 -24
- data/test/controllers/helpers_test.rb +0 -318
- data/test/controllers/inherited_controller_i18n_messages_test.rb +0 -53
- data/test/controllers/internal_helpers_test.rb +0 -129
- data/test/controllers/load_hooks_controller_test.rb +0 -21
- data/test/controllers/passwords_controller_test.rb +0 -34
- data/test/controllers/sessions_controller_test.rb +0 -108
- data/test/controllers/url_helpers_test.rb +0 -67
- data/test/delegator_test.rb +0 -21
- data/test/devise_test.rb +0 -109
- data/test/failure_app_test.rb +0 -340
- data/test/generators/active_record_generator_test.rb +0 -130
- data/test/generators/controllers_generator_test.rb +0 -50
- data/test/generators/devise_generator_test.rb +0 -41
- data/test/generators/install_generator_test.rb +0 -26
- data/test/generators/mongoid_generator_test.rb +0 -25
- data/test/generators/views_generator_test.rb +0 -105
- data/test/helpers/devise_helper_test.rb +0 -51
- data/test/integration/authenticatable_test.rb +0 -706
- data/test/integration/confirmable_test.rb +0 -326
- data/test/integration/database_authenticatable_test.rb +0 -97
- data/test/integration/http_authenticatable_test.rb +0 -114
- data/test/integration/lockable_test.rb +0 -242
- data/test/integration/mounted_engine_test.rb +0 -38
- data/test/integration/omniauthable_test.rb +0 -148
- data/test/integration/recoverable_test.rb +0 -349
- data/test/integration/registerable_test.rb +0 -365
- data/test/integration/rememberable_test.rb +0 -219
- data/test/integration/timeoutable_test.rb +0 -186
- data/test/integration/trackable_test.rb +0 -99
- data/test/mailers/confirmation_instructions_test.rb +0 -117
- data/test/mailers/email_changed_test.rb +0 -132
- data/test/mailers/mailer_test.rb +0 -20
- data/test/mailers/reset_password_instructions_test.rb +0 -98
- data/test/mailers/unlock_instructions_test.rb +0 -93
- data/test/mapping_test.rb +0 -136
- data/test/models/authenticatable_test.rb +0 -25
- data/test/models/confirmable_test.rb +0 -549
- data/test/models/database_authenticatable_test.rb +0 -283
- data/test/models/lockable_test.rb +0 -352
- data/test/models/omniauthable_test.rb +0 -9
- data/test/models/recoverable_test.rb +0 -263
- data/test/models/registerable_test.rb +0 -9
- data/test/models/rememberable_test.rb +0 -184
- data/test/models/serializable_test.rb +0 -60
- data/test/models/timeoutable_test.rb +0 -53
- data/test/models/trackable_test.rb +0 -62
- data/test/models/validatable_test.rb +0 -121
- data/test/models_test.rb +0 -155
- data/test/omniauth/config_test.rb +0 -61
- data/test/omniauth/url_helpers_test.rb +0 -53
- data/test/orm/active_record.rb +0 -24
- data/test/orm/mongoid.rb +0 -15
- data/test/parameter_sanitizer_test.rb +0 -77
- data/test/rails_app/Rakefile +0 -6
- data/test/rails_app/app/active_record/admin.rb +0 -8
- data/test/rails_app/app/active_record/shim.rb +0 -4
- data/test/rails_app/app/active_record/user.rb +0 -20
- data/test/rails_app/app/active_record/user_on_engine.rb +0 -9
- data/test/rails_app/app/active_record/user_on_main_app.rb +0 -9
- data/test/rails_app/app/active_record/user_with_validations.rb +0 -12
- data/test/rails_app/app/active_record/user_without_email.rb +0 -10
- data/test/rails_app/app/controllers/admins/sessions_controller.rb +0 -8
- data/test/rails_app/app/controllers/admins_controller.rb +0 -8
- data/test/rails_app/app/controllers/application_controller.rb +0 -13
- data/test/rails_app/app/controllers/application_with_fake_engine.rb +0 -32
- data/test/rails_app/app/controllers/custom/registrations_controller.rb +0 -33
- data/test/rails_app/app/controllers/home_controller.rb +0 -31
- data/test/rails_app/app/controllers/publisher/registrations_controller.rb +0 -4
- data/test/rails_app/app/controllers/publisher/sessions_controller.rb +0 -4
- data/test/rails_app/app/controllers/users/omniauth_callbacks_controller.rb +0 -16
- data/test/rails_app/app/controllers/users_controller.rb +0 -33
- data/test/rails_app/app/helpers/application_helper.rb +0 -5
- data/test/rails_app/app/mailers/users/from_proc_mailer.rb +0 -5
- data/test/rails_app/app/mailers/users/mailer.rb +0 -5
- data/test/rails_app/app/mailers/users/reply_to_mailer.rb +0 -6
- data/test/rails_app/app/mongoid/admin.rb +0 -31
- data/test/rails_app/app/mongoid/shim.rb +0 -25
- data/test/rails_app/app/mongoid/user.rb +0 -50
- data/test/rails_app/app/mongoid/user_on_engine.rb +0 -41
- data/test/rails_app/app/mongoid/user_on_main_app.rb +0 -41
- data/test/rails_app/app/mongoid/user_with_validations.rb +0 -37
- data/test/rails_app/app/mongoid/user_without_email.rb +0 -35
- data/test/rails_app/app/views/admins/index.html.erb +0 -1
- data/test/rails_app/app/views/admins/sessions/new.html.erb +0 -2
- data/test/rails_app/app/views/home/admin_dashboard.html.erb +0 -1
- data/test/rails_app/app/views/home/index.html.erb +0 -1
- data/test/rails_app/app/views/home/join.html.erb +0 -1
- data/test/rails_app/app/views/home/private.html.erb +0 -1
- data/test/rails_app/app/views/home/user_dashboard.html.erb +0 -1
- data/test/rails_app/app/views/layouts/application.html.erb +0 -24
- data/test/rails_app/app/views/users/edit_form.html.erb +0 -1
- data/test/rails_app/app/views/users/index.html.erb +0 -1
- data/test/rails_app/app/views/users/mailer/confirmation_instructions.erb +0 -1
- data/test/rails_app/app/views/users/sessions/new.html.erb +0 -1
- data/test/rails_app/bin/bundle +0 -3
- data/test/rails_app/bin/rails +0 -4
- data/test/rails_app/bin/rake +0 -4
- data/test/rails_app/config/application.rb +0 -48
- data/test/rails_app/config/boot.rb +0 -27
- data/test/rails_app/config/database.yml +0 -18
- data/test/rails_app/config/environment.rb +0 -7
- data/test/rails_app/config/environments/development.rb +0 -32
- data/test/rails_app/config/environments/production.rb +0 -88
- data/test/rails_app/config/environments/test.rb +0 -47
- data/test/rails_app/config/initializers/backtrace_silencers.rb +0 -9
- data/test/rails_app/config/initializers/devise.rb +0 -182
- data/test/rails_app/config/initializers/inflections.rb +0 -4
- data/test/rails_app/config/initializers/secret_token.rb +0 -5
- data/test/rails_app/config/initializers/session_store.rb +0 -3
- data/test/rails_app/config/routes.rb +0 -128
- data/test/rails_app/config.ru +0 -4
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -77
- data/test/rails_app/db/schema.rb +0 -57
- data/test/rails_app/lib/shared_admin.rb +0 -23
- data/test/rails_app/lib/shared_user.rb +0 -32
- data/test/rails_app/lib/shared_user_without_email.rb +0 -28
- data/test/rails_app/lib/shared_user_without_omniauth.rb +0 -15
- data/test/rails_app/public/404.html +0 -26
- data/test/rails_app/public/422.html +0 -26
- data/test/rails_app/public/500.html +0 -26
- data/test/rails_app/public/favicon.ico +0 -0
- data/test/rails_test.rb +0 -11
- data/test/routes_test.rb +0 -281
- data/test/secret_key_finder_test.rb +0 -97
- data/test/support/action_controller/record_identifier.rb +0 -12
- data/test/support/assertions.rb +0 -30
- data/test/support/helpers.rb +0 -83
- data/test/support/http_method_compatibility.rb +0 -53
- data/test/support/integration.rb +0 -95
- data/test/support/locale/en.yml +0 -8
- data/test/support/mongoid.yml +0 -6
- data/test/support/webrat/integrations/rails.rb +0 -35
- data/test/test/controller_helpers_test.rb +0 -193
- data/test/test/integration_helpers_test.rb +0 -34
- data/test/test_helper.rb +0 -36
- data/test/test_models.rb +0 -35
@@ -1,201 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/rails/activemodel-serializers-xml.git
|
3
|
-
revision: 356edf4dfc38fb1fbfee90c87856e4fe5b73c5e1
|
4
|
-
specs:
|
5
|
-
activemodel-serializers-xml (1.0.2)
|
6
|
-
activemodel (> 5.x)
|
7
|
-
activesupport (> 5.x)
|
8
|
-
builder (~> 3.1)
|
9
|
-
|
10
|
-
PATH
|
11
|
-
remote: ..
|
12
|
-
specs:
|
13
|
-
devise (4.4.3)
|
14
|
-
bcrypt (~> 3.0)
|
15
|
-
orm_adapter (~> 0.1)
|
16
|
-
railties (>= 4.1.0, < 6.0)
|
17
|
-
responders
|
18
|
-
warden (~> 1.2.3)
|
19
|
-
|
20
|
-
GEM
|
21
|
-
remote: https://rubygems.org/
|
22
|
-
specs:
|
23
|
-
actioncable (5.2.0.rc1)
|
24
|
-
actionpack (= 5.2.0.rc1)
|
25
|
-
nio4r (~> 2.0)
|
26
|
-
websocket-driver (>= 0.6.1)
|
27
|
-
actionmailer (5.2.0.rc1)
|
28
|
-
actionpack (= 5.2.0.rc1)
|
29
|
-
actionview (= 5.2.0.rc1)
|
30
|
-
activejob (= 5.2.0.rc1)
|
31
|
-
mail (~> 2.5, >= 2.5.4)
|
32
|
-
rails-dom-testing (~> 2.0)
|
33
|
-
actionpack (5.2.0.rc1)
|
34
|
-
actionview (= 5.2.0.rc1)
|
35
|
-
activesupport (= 5.2.0.rc1)
|
36
|
-
rack (~> 2.0)
|
37
|
-
rack-test (>= 0.6.3)
|
38
|
-
rails-dom-testing (~> 2.0)
|
39
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
40
|
-
actionview (5.2.0.rc1)
|
41
|
-
activesupport (= 5.2.0.rc1)
|
42
|
-
builder (~> 3.1)
|
43
|
-
erubi (~> 1.4)
|
44
|
-
rails-dom-testing (~> 2.0)
|
45
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
46
|
-
activejob (5.2.0.rc1)
|
47
|
-
activesupport (= 5.2.0.rc1)
|
48
|
-
globalid (>= 0.3.6)
|
49
|
-
activemodel (5.2.0.rc1)
|
50
|
-
activesupport (= 5.2.0.rc1)
|
51
|
-
activerecord (5.2.0.rc1)
|
52
|
-
activemodel (= 5.2.0.rc1)
|
53
|
-
activesupport (= 5.2.0.rc1)
|
54
|
-
arel (>= 9.0)
|
55
|
-
activestorage (5.2.0.rc1)
|
56
|
-
actionpack (= 5.2.0.rc1)
|
57
|
-
activerecord (= 5.2.0.rc1)
|
58
|
-
marcel (~> 0.3.1)
|
59
|
-
activesupport (5.2.0.rc1)
|
60
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
61
|
-
i18n (~> 0.7)
|
62
|
-
minitest (~> 5.1)
|
63
|
-
tzinfo (~> 1.1)
|
64
|
-
arel (9.0.0)
|
65
|
-
bcrypt (3.1.11)
|
66
|
-
builder (3.2.3)
|
67
|
-
concurrent-ruby (1.0.5)
|
68
|
-
crass (1.0.3)
|
69
|
-
erubi (1.7.0)
|
70
|
-
faraday (0.12.2)
|
71
|
-
multipart-post (>= 1.2, < 3)
|
72
|
-
globalid (0.4.1)
|
73
|
-
activesupport (>= 4.2.0)
|
74
|
-
hashie (3.5.7)
|
75
|
-
i18n (0.9.3)
|
76
|
-
concurrent-ruby (~> 1.0)
|
77
|
-
jwt (1.5.6)
|
78
|
-
loofah (2.1.1)
|
79
|
-
crass (~> 1.0.2)
|
80
|
-
nokogiri (>= 1.5.9)
|
81
|
-
mail (2.7.0)
|
82
|
-
mini_mime (>= 0.1.1)
|
83
|
-
marcel (0.3.1)
|
84
|
-
mimemagic (~> 0.3.2)
|
85
|
-
metaclass (0.0.4)
|
86
|
-
method_source (0.9.0)
|
87
|
-
mimemagic (0.3.2)
|
88
|
-
mini_mime (1.0.0)
|
89
|
-
mini_portile2 (2.3.0)
|
90
|
-
minitest (5.11.3)
|
91
|
-
mocha (1.3.0)
|
92
|
-
metaclass (~> 0.0.1)
|
93
|
-
multi_json (1.13.1)
|
94
|
-
multi_xml (0.6.0)
|
95
|
-
multipart-post (2.0.0)
|
96
|
-
nio4r (2.2.0)
|
97
|
-
nokogiri (1.8.2)
|
98
|
-
mini_portile2 (~> 2.3.0)
|
99
|
-
oauth2 (1.4.0)
|
100
|
-
faraday (>= 0.8, < 0.13)
|
101
|
-
jwt (~> 1.0)
|
102
|
-
multi_json (~> 1.3)
|
103
|
-
multi_xml (~> 0.5)
|
104
|
-
rack (>= 1.2, < 3)
|
105
|
-
omniauth (1.8.1)
|
106
|
-
hashie (>= 3.4.6, < 3.6.0)
|
107
|
-
rack (>= 1.6.2, < 3)
|
108
|
-
omniauth-facebook (4.0.0)
|
109
|
-
omniauth-oauth2 (~> 1.2)
|
110
|
-
omniauth-oauth2 (1.5.0)
|
111
|
-
oauth2 (~> 1.1)
|
112
|
-
omniauth (~> 1.2)
|
113
|
-
omniauth-openid (1.0.1)
|
114
|
-
omniauth (~> 1.0)
|
115
|
-
rack-openid (~> 1.3.1)
|
116
|
-
orm_adapter (0.5.0)
|
117
|
-
rack (2.0.4)
|
118
|
-
rack-openid (1.3.1)
|
119
|
-
rack (>= 1.1.0)
|
120
|
-
ruby-openid (>= 2.1.8)
|
121
|
-
rack-test (0.8.2)
|
122
|
-
rack (>= 1.0, < 3)
|
123
|
-
rails (5.2.0.rc1)
|
124
|
-
actioncable (= 5.2.0.rc1)
|
125
|
-
actionmailer (= 5.2.0.rc1)
|
126
|
-
actionpack (= 5.2.0.rc1)
|
127
|
-
actionview (= 5.2.0.rc1)
|
128
|
-
activejob (= 5.2.0.rc1)
|
129
|
-
activemodel (= 5.2.0.rc1)
|
130
|
-
activerecord (= 5.2.0.rc1)
|
131
|
-
activestorage (= 5.2.0.rc1)
|
132
|
-
activesupport (= 5.2.0.rc1)
|
133
|
-
bundler (>= 1.3.0)
|
134
|
-
railties (= 5.2.0.rc1)
|
135
|
-
sprockets-rails (>= 2.0.0)
|
136
|
-
rails-controller-testing (1.0.2)
|
137
|
-
actionpack (~> 5.x, >= 5.0.1)
|
138
|
-
actionview (~> 5.x, >= 5.0.1)
|
139
|
-
activesupport (~> 5.x)
|
140
|
-
rails-dom-testing (2.0.3)
|
141
|
-
activesupport (>= 4.2.0)
|
142
|
-
nokogiri (>= 1.6)
|
143
|
-
rails-html-sanitizer (1.0.3)
|
144
|
-
loofah (~> 2.0)
|
145
|
-
railties (5.2.0.rc1)
|
146
|
-
actionpack (= 5.2.0.rc1)
|
147
|
-
activesupport (= 5.2.0.rc1)
|
148
|
-
method_source
|
149
|
-
rake (>= 0.8.7)
|
150
|
-
thor (>= 0.18.1, < 2.0)
|
151
|
-
rake (12.3.0)
|
152
|
-
rdoc (6.0.1)
|
153
|
-
responders (2.4.0)
|
154
|
-
actionpack (>= 4.2.0, < 5.3)
|
155
|
-
railties (>= 4.2.0, < 5.3)
|
156
|
-
ruby-openid (2.7.0)
|
157
|
-
sprockets (3.7.1)
|
158
|
-
concurrent-ruby (~> 1.0)
|
159
|
-
rack (> 1, < 3)
|
160
|
-
sprockets-rails (3.2.1)
|
161
|
-
actionpack (>= 4.0)
|
162
|
-
activesupport (>= 4.0)
|
163
|
-
sprockets (>= 3.0.0)
|
164
|
-
sqlite3 (1.3.13)
|
165
|
-
test_after_commit (1.1.0)
|
166
|
-
activerecord (>= 3.2)
|
167
|
-
thor (0.20.0)
|
168
|
-
thread_safe (0.3.6)
|
169
|
-
tzinfo (1.2.5)
|
170
|
-
thread_safe (~> 0.1)
|
171
|
-
warden (1.2.7)
|
172
|
-
rack (>= 1.0)
|
173
|
-
webrat (0.7.3)
|
174
|
-
nokogiri (>= 1.2.0)
|
175
|
-
rack (>= 1.0)
|
176
|
-
rack-test (>= 0.5.3)
|
177
|
-
websocket-driver (0.7.0)
|
178
|
-
websocket-extensions (>= 0.1.0)
|
179
|
-
websocket-extensions (0.1.3)
|
180
|
-
|
181
|
-
PLATFORMS
|
182
|
-
ruby
|
183
|
-
|
184
|
-
DEPENDENCIES
|
185
|
-
activemodel-serializers-xml!
|
186
|
-
devise!
|
187
|
-
mocha (~> 1.1)
|
188
|
-
omniauth
|
189
|
-
omniauth-facebook
|
190
|
-
omniauth-oauth2
|
191
|
-
omniauth-openid
|
192
|
-
rails (~> 5.2.0.rc1)
|
193
|
-
rails-controller-testing
|
194
|
-
rdoc
|
195
|
-
responders (~> 2.1)
|
196
|
-
sqlite3
|
197
|
-
test_after_commit
|
198
|
-
webrat (= 0.7.3)
|
199
|
-
|
200
|
-
BUNDLED WITH
|
201
|
-
1.16.1
|
@@ -1,106 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'bundler/inline'
|
5
|
-
rescue LoadError => e
|
6
|
-
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
|
7
|
-
raise e
|
8
|
-
end
|
9
|
-
|
10
|
-
gemfile(true) do
|
11
|
-
source 'https://rubygems.org'
|
12
|
-
# Activate the gem you are reporting the issue against.
|
13
|
-
gem 'rails', '~> 4.2.0'
|
14
|
-
gem 'devise', '~> 4.0'
|
15
|
-
gem 'sqlite3'
|
16
|
-
gem 'byebug'
|
17
|
-
end
|
18
|
-
|
19
|
-
require 'rack/test'
|
20
|
-
require 'action_controller/railtie'
|
21
|
-
require 'active_record'
|
22
|
-
require 'devise/rails/routes'
|
23
|
-
require 'devise/rails/warden_compat'
|
24
|
-
|
25
|
-
ActiveRecord::Base.establish_connection( adapter: :sqlite3, database: ':memory:')
|
26
|
-
|
27
|
-
class DeviseCreateUsers < ActiveRecord::Migration
|
28
|
-
def change
|
29
|
-
create_table(:users) do |t|
|
30
|
-
t.string :email, null: false
|
31
|
-
t.string :encrypted_password, null: true
|
32
|
-
t.timestamps null: false
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
Devise.setup do |config|
|
39
|
-
require 'devise/orm/active_record'
|
40
|
-
config.secret_key = 'secret_key_base'
|
41
|
-
end
|
42
|
-
|
43
|
-
class TestApp < Rails::Application
|
44
|
-
config.root = File.dirname(__FILE__)
|
45
|
-
config.session_store :cookie_store, key: 'cookie_store_key'
|
46
|
-
secrets.secret_token = 'secret_token'
|
47
|
-
secrets.secret_key_base = 'secret_key_base'
|
48
|
-
config.eager_load = false
|
49
|
-
|
50
|
-
config.middleware.use Warden::Manager do |config|
|
51
|
-
Devise.warden_config = config
|
52
|
-
end
|
53
|
-
|
54
|
-
config.logger = Logger.new($stdout)
|
55
|
-
Rails.logger = config.logger
|
56
|
-
|
57
|
-
end
|
58
|
-
|
59
|
-
Rails.application.initialize!
|
60
|
-
|
61
|
-
DeviseCreateUsers.migrate(:up)
|
62
|
-
|
63
|
-
class User < ActiveRecord::Base
|
64
|
-
devise :database_authenticatable
|
65
|
-
end
|
66
|
-
|
67
|
-
Rails.application.routes.draw do
|
68
|
-
devise_for :users
|
69
|
-
|
70
|
-
get '/' => 'test#index'
|
71
|
-
end
|
72
|
-
|
73
|
-
class ApplicationController < ActionController::Base
|
74
|
-
end
|
75
|
-
|
76
|
-
class TestController < ApplicationController
|
77
|
-
include Rails.application.routes.url_helpers
|
78
|
-
|
79
|
-
before_filter :authenticate_user!
|
80
|
-
|
81
|
-
def index
|
82
|
-
render plain: 'Home'
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
require 'minitest/autorun'
|
87
|
-
|
88
|
-
class BugTest < ActionDispatch::IntegrationTest
|
89
|
-
include Rack::Test::Methods
|
90
|
-
include Warden::Test::Helpers
|
91
|
-
|
92
|
-
def test_returns_success
|
93
|
-
Warden.test_mode!
|
94
|
-
|
95
|
-
login_as User.create!(email: 'test@test.com', password: 'test123456', password_confirmation: 'test123456')
|
96
|
-
|
97
|
-
get '/'
|
98
|
-
assert last_response.ok?
|
99
|
-
end
|
100
|
-
|
101
|
-
private
|
102
|
-
|
103
|
-
def app
|
104
|
-
Rails.application
|
105
|
-
end
|
106
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
class CustomRegistrationsControllerTest < Devise::ControllerTestCase
|
6
|
-
tests Custom::RegistrationsController
|
7
|
-
|
8
|
-
include Devise::Test::ControllerHelpers
|
9
|
-
|
10
|
-
setup do
|
11
|
-
request.env["devise.mapping"] = Devise.mappings[:user]
|
12
|
-
@password = 'password'
|
13
|
-
@user = create_user(password: @password, password_confirmation: @password).tap(&:confirm)
|
14
|
-
end
|
15
|
-
|
16
|
-
test "yield resource to block on create success" do
|
17
|
-
post :create, params: { user: { email: "user@example.org", password: "password", password_confirmation: "password" } }
|
18
|
-
assert @controller.create_block_called?, "create failed to yield resource to provided block"
|
19
|
-
end
|
20
|
-
|
21
|
-
test "yield resource to block on create failure" do
|
22
|
-
post :create, params: { user: { } }
|
23
|
-
assert @controller.create_block_called?, "create failed to yield resource to provided block"
|
24
|
-
end
|
25
|
-
|
26
|
-
test "yield resource to block on update success" do
|
27
|
-
sign_in @user
|
28
|
-
put :update, params: { user: { current_password: @password } }
|
29
|
-
assert @controller.update_block_called?, "update failed to yield resource to provided block"
|
30
|
-
end
|
31
|
-
|
32
|
-
test "yield resource to block on update failure" do
|
33
|
-
sign_in @user
|
34
|
-
put :update, params: { user: { } }
|
35
|
-
assert @controller.update_block_called?, "update failed to yield resource to provided block"
|
36
|
-
end
|
37
|
-
|
38
|
-
test "yield resource to block on new" do
|
39
|
-
get :new
|
40
|
-
assert @controller.new_block_called?, "new failed to yield resource to provided block"
|
41
|
-
end
|
42
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
require 'ostruct'
|
5
|
-
require 'warden/strategies/base'
|
6
|
-
require 'devise/test_helpers'
|
7
|
-
|
8
|
-
class CustomStrategyController < ActionController::Base
|
9
|
-
def new
|
10
|
-
warden.authenticate!(:custom_strategy)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
# These tests are to prove that a warden strategy can successfully
|
15
|
-
# return a custom response, including a specific status code and
|
16
|
-
# custom http response headers. This does work in production,
|
17
|
-
# however, at the time of writing this, the Devise test helpers do
|
18
|
-
# not recognise the custom response and proceed to calling the
|
19
|
-
# Failure App. This makes it impossible to write tests for a
|
20
|
-
# strategy that return a custom response with Devise.
|
21
|
-
class CustomStrategy < Warden::Strategies::Base
|
22
|
-
def authenticate!
|
23
|
-
custom_headers = { "X-FOO" => "BAR" }
|
24
|
-
response = Rack::Response.new("BAD REQUEST", 400, custom_headers)
|
25
|
-
custom! response.finish
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
class CustomStrategyTest < Devise::ControllerTestCase
|
30
|
-
tests CustomStrategyController
|
31
|
-
|
32
|
-
include Devise::Test::ControllerHelpers
|
33
|
-
|
34
|
-
setup do
|
35
|
-
Warden::Strategies.add(:custom_strategy, CustomStrategy)
|
36
|
-
end
|
37
|
-
|
38
|
-
teardown do
|
39
|
-
Warden::Strategies._strategies.delete(:custom_strategy)
|
40
|
-
end
|
41
|
-
|
42
|
-
test "custom strategy can return its own status code" do
|
43
|
-
ret = get :new
|
44
|
-
|
45
|
-
# check the returned rack array
|
46
|
-
# assert ret.is_a?(Array)
|
47
|
-
# assert_equal 400, ret.first
|
48
|
-
assert ret.is_a?(ActionDispatch::TestResponse)
|
49
|
-
|
50
|
-
# check the saved response as well. This is purely so that the response is available to the testing framework
|
51
|
-
# for verification. In production, the above array would be delivered directly to Rack.
|
52
|
-
assert_response 400
|
53
|
-
end
|
54
|
-
|
55
|
-
test "custom strategy can return custom headers" do
|
56
|
-
ret = get :new
|
57
|
-
|
58
|
-
# check the returned rack array
|
59
|
-
# assert ret.is_a?(Array)
|
60
|
-
# assert_equal ret.third['X-FOO'], 'BAR'
|
61
|
-
assert ret.is_a?(ActionDispatch::TestResponse)
|
62
|
-
|
63
|
-
# check the saved response headers as well.
|
64
|
-
assert_equal response.headers['X-FOO'], 'BAR'
|
65
|
-
end
|
66
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
class ApiController < ActionController::Metal
|
6
|
-
include Devise::Controllers::Helpers
|
7
|
-
end
|
8
|
-
|
9
|
-
class HelperMethodsTest < Devise::ControllerTestCase
|
10
|
-
tests ApiController
|
11
|
-
|
12
|
-
test 'includes Devise::Controllers::Helpers' do
|
13
|
-
assert_includes @controller.class.ancestors, Devise::Controllers::Helpers
|
14
|
-
end
|
15
|
-
|
16
|
-
test 'does not respond_to helper or helper_method' do
|
17
|
-
refute_respond_to @controller.class, :helper
|
18
|
-
refute_respond_to @controller.class, :helper_method
|
19
|
-
end
|
20
|
-
|
21
|
-
test 'defines methods like current_user' do
|
22
|
-
assert_respond_to @controller, :current_user
|
23
|
-
end
|
24
|
-
end
|