devise_token_auth 0.1.20 → 0.1.21.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +274 -77
  3. data/app/controllers/devise_token_auth/auth_controller.rb +4 -1
  4. data/app/controllers/devise_token_auth/concerns/set_user_by_token.rb +8 -2
  5. data/app/controllers/devise_token_auth/confirmations_controller.rb +1 -1
  6. data/app/controllers/devise_token_auth/passwords_controller.rb +3 -3
  7. data/app/controllers/devise_token_auth/registrations_controller.rb +1 -1
  8. data/app/controllers/devise_token_auth/sessions_controller.rb +1 -1
  9. data/app/models/{user.rb → devise_token_auth/concerns/user.rb} +28 -23
  10. data/config/initializers/devise.rb +4 -64
  11. data/config/routes.rb +2 -14
  12. data/lib/devise_token_auth/engine.rb +5 -1
  13. data/lib/devise_token_auth/rails/routes.rb +36 -0
  14. data/lib/devise_token_auth/version.rb +1 -1
  15. data/lib/generators/devise_token_auth/USAGE +23 -5
  16. data/lib/generators/devise_token_auth/install_generator.rb +69 -5
  17. data/lib/generators/devise_token_auth/templates/devise_token_auth.rb +5 -0
  18. data/lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb.erb +56 -0
  19. data/lib/generators/devise_token_auth/templates/user.rb +3 -0
  20. data/test/controllers/demo_controller_test.rb +39 -4
  21. data/test/controllers/devise_token_auth/auth_controller_test.rb +98 -0
  22. data/test/controllers/devise_token_auth/confirmations_controller_test.rb +37 -2
  23. data/test/controllers/devise_token_auth/passwords_controller_test.rb +38 -2
  24. data/test/controllers/devise_token_auth/registrations_controller_test.rb +31 -4
  25. data/test/controllers/devise_token_auth/sessions_controller_test.rb +32 -0
  26. data/test/dummy/app/assets/images/omniauth-provider-settings.png +0 -0
  27. data/test/dummy/app/models/mang.rb +3 -0
  28. data/test/dummy/app/models/user.rb +3 -0
  29. data/test/dummy/config/initializers/devise_token_auth.rb +5 -0
  30. data/test/dummy/config/routes.rb +16 -1
  31. data/test/dummy/db/development.sqlite3 +0 -0
  32. data/{lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb → test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb} +0 -0
  33. data/test/dummy/db/migrate/{20140714223034_devise_token_auth_create_users.rb → 20140715061805_devise_token_auth_create_mangs.rb} +7 -7
  34. data/test/dummy/db/schema.rb +35 -4
  35. data/test/dummy/db/test.sqlite3 +0 -0
  36. data/test/dummy/log/development.log +7601 -0
  37. data/test/dummy/log/test.log +128490 -0
  38. data/test/fixtures/mangs.yml +31 -0
  39. data/test/test_helper.rb +13 -9
  40. metadata +22 -8
@@ -0,0 +1,31 @@
1
+ <% timestamp = DateTime.parse(2.weeks.ago.to_s).to_time.strftime("%F %T") %>
2
+ <% @email = Faker::Internet.email %>
3
+ confirmed_email_user:
4
+ uid: "<%= @email %>"
5
+ email: "<%= @email %>"
6
+ provider: 'email'
7
+ confirmed_at: '<%= timestamp %>'
8
+ created_at: '<%= timestamp %>'
9
+ updated_at: '<%= timestamp %>'
10
+ confirm_success_url: '<%= Faker::Internet.url %>'
11
+ encrypted_password: <%= Mang.new.send(:password_digest, 'secret123') %>
12
+
13
+ <% @fb_email = Faker::Internet.email %>
14
+ duplicate_email_facebook_user:
15
+ uid: "<%= Faker::Number.number(10) %>"
16
+ email: "<%= @fb_email %>"
17
+ provider: 'facebook'
18
+ created_at: '<%= timestamp %>'
19
+ updated_at: '<%= timestamp %>'
20
+ confirmed_at: '<%= timestamp %>'
21
+ encrypted_password: <%= Mang.new.send(:password_digest, 'secret123') %>
22
+
23
+ <% @unconfirmed_email = Faker::Internet.email %>
24
+ unconfirmed_email_user:
25
+ uid: "<%= @unconfirmed_email %>"
26
+ email: "<%= @unconfirmed_email %>"
27
+ provider: 'email'
28
+ confirm_success_url: '<%= Faker::Internet.url %>'
29
+ created_at: '<%= timestamp %>'
30
+ updated_at: '<%= timestamp %>'
31
+ encrypted_password: <%= Mang.new.send(:password_digest, 'secret123') %>
data/test/test_helper.rb CHANGED
@@ -1,4 +1,8 @@
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
3
+
1
4
  ENV["RAILS_ENV"] = "test"
5
+
2
6
  require File.expand_path("../dummy/config/environment", __FILE__)
3
7
  require "rails/test_help"
4
8
  require "minitest/rails"
@@ -10,7 +14,8 @@ require "minitest/rails"
10
14
  # Uncomment for awesome colorful output
11
15
  require "minitest/pride"
12
16
 
13
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
17
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
18
+ ActionDispatch::IntegrationTest.fixture_path = File.expand_path("../fixtures", __FILE__)
14
19
 
15
20
  # I hate the default reporter. Use ProgressReporter instead.
16
21
  Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
@@ -18,8 +23,6 @@ Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new
18
23
  class ActiveSupport::TestCase
19
24
  ActiveRecord::Migration.check_pending!
20
25
 
21
- include Devise::TestHelpers
22
-
23
26
  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
24
27
  #
25
28
  # Note: You'll currently still have to declare fixtures explicitly in integration tests
@@ -27,13 +30,14 @@ class ActiveSupport::TestCase
27
30
  fixtures :all
28
31
 
29
32
  # Add more helper methods to be used by all tests here...
33
+ end
30
34
 
31
- setup do
32
- @routes = DeviseTokenAuth::Engine.routes
33
- end
35
+ class ActionController::TestCase
36
+ include Devise::TestHelpers
34
37
 
35
- before do
36
- @request.env["devise.mapping"] = Devise.mappings[:user]
38
+ setup do
39
+ @routes = Dummy::Application.routes
40
+ @request.env['devise.mapping'] = Devise.mappings[:user]
37
41
  end
38
42
 
39
43
  def age_token(user, client_id)
@@ -42,7 +46,7 @@ class ActiveSupport::TestCase
42
46
  end
43
47
 
44
48
  def expire_token(user, client_id)
45
- user.tokens[client_id]['expiry'] = Time.now - (DeviseTokenAuth.token_lifespan.to_f + 10.seconds)
49
+ user.tokens[client_id]['expiry'] = (Time.now - (DeviseTokenAuth.token_lifespan.to_f + 10.seconds)).to_i
46
50
  user.save
47
51
  end
48
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_token_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lynn Hurley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-15 00:00:00.000000000 Z
11
+ date: 2014-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -100,7 +100,7 @@ files:
100
100
  - app/controllers/devise_token_auth/registrations_controller.rb
101
101
  - app/controllers/devise_token_auth/sessions_controller.rb
102
102
  - app/helpers/devise_token_auth/application_helper.rb
103
- - app/models/user.rb
103
+ - app/models/devise_token_auth/concerns/user.rb
104
104
  - app/views/devise/mailer/confirmation_instructions.html.erb
105
105
  - app/views/devise/mailer/reset_password_instructions.html.erb
106
106
  - app/views/devise/mailer/unlock_instructions.html.erb
@@ -112,24 +112,30 @@ files:
112
112
  - config/routes.rb
113
113
  - lib/devise_token_auth.rb
114
114
  - lib/devise_token_auth/engine.rb
115
+ - lib/devise_token_auth/rails/routes.rb
115
116
  - lib/devise_token_auth/version.rb
116
117
  - lib/generators/devise_token_auth/USAGE
117
118
  - lib/generators/devise_token_auth/install_generator.rb
118
119
  - lib/generators/devise_token_auth/templates/devise_token_auth.rb
119
- - lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb
120
+ - lib/generators/devise_token_auth/templates/devise_token_auth_create_users.rb.erb
121
+ - lib/generators/devise_token_auth/templates/user.rb
120
122
  - lib/tasks/devise_token_auth_tasks.rake
121
123
  - test/controllers/demo_controller_test.rb
124
+ - test/controllers/devise_token_auth/auth_controller_test.rb
122
125
  - test/controllers/devise_token_auth/confirmations_controller_test.rb
123
126
  - test/controllers/devise_token_auth/passwords_controller_test.rb
124
127
  - test/controllers/devise_token_auth/registrations_controller_test.rb
125
128
  - test/controllers/devise_token_auth/sessions_controller_test.rb
126
129
  - test/dummy/README.rdoc
127
130
  - test/dummy/Rakefile
131
+ - test/dummy/app/assets/images/omniauth-provider-settings.png
128
132
  - test/dummy/app/assets/javascripts/application.js
129
133
  - test/dummy/app/assets/stylesheets/application.css
130
134
  - test/dummy/app/controllers/application_controller.rb
131
135
  - test/dummy/app/controllers/demo_controller.rb
132
136
  - test/dummy/app/helpers/application_helper.rb
137
+ - test/dummy/app/models/mang.rb
138
+ - test/dummy/app/models/user.rb
133
139
  - test/dummy/app/views/layouts/application.html.erb
134
140
  - test/dummy/bin/bundle
135
141
  - test/dummy/bin/rails
@@ -160,7 +166,8 @@ files:
160
166
  - test/dummy/config/secrets.yml
161
167
  - test/dummy/config/spring.rb
162
168
  - test/dummy/db/development.sqlite3
163
- - test/dummy/db/migrate/20140714223034_devise_token_auth_create_users.rb
169
+ - test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
170
+ - test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
164
171
  - test/dummy/db/schema.rb
165
172
  - test/dummy/db/test.sqlite3
166
173
  - test/dummy/log/development.log
@@ -170,6 +177,7 @@ files:
170
177
  - test/dummy/public/500.html
171
178
  - test/dummy/public/favicon.ico
172
179
  - test/dummy/tmp/restart.txt
180
+ - test/fixtures/mangs.yml
173
181
  - test/fixtures/users.yml
174
182
  - test/integration/navigation_test.rb
175
183
  - test/lib/generators/devise_token_auth/install_generator_test.rb
@@ -189,9 +197,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
189
197
  version: '0'
190
198
  required_rubygems_version: !ruby/object:Gem::Requirement
191
199
  requirements:
192
- - - ">="
200
+ - - ">"
193
201
  - !ruby/object:Gem::Version
194
- version: '0'
202
+ version: 1.3.1
195
203
  requirements: []
196
204
  rubyforge_project:
197
205
  rubygems_version: 2.2.2
@@ -200,15 +208,19 @@ specification_version: 4
200
208
  summary: Token based authentication for rails. Uses Devies + Omniauth.
201
209
  test_files:
202
210
  - test/controllers/demo_controller_test.rb
211
+ - test/controllers/devise_token_auth/auth_controller_test.rb
203
212
  - test/controllers/devise_token_auth/confirmations_controller_test.rb
204
213
  - test/controllers/devise_token_auth/passwords_controller_test.rb
205
214
  - test/controllers/devise_token_auth/registrations_controller_test.rb
206
215
  - test/controllers/devise_token_auth/sessions_controller_test.rb
216
+ - test/dummy/app/assets/images/omniauth-provider-settings.png
207
217
  - test/dummy/app/assets/javascripts/application.js
208
218
  - test/dummy/app/assets/stylesheets/application.css
209
219
  - test/dummy/app/controllers/application_controller.rb
210
220
  - test/dummy/app/controllers/demo_controller.rb
211
221
  - test/dummy/app/helpers/application_helper.rb
222
+ - test/dummy/app/models/mang.rb
223
+ - test/dummy/app/models/user.rb
212
224
  - test/dummy/app/views/layouts/application.html.erb
213
225
  - test/dummy/bin/bundle
214
226
  - test/dummy/bin/rails
@@ -239,7 +251,8 @@ test_files:
239
251
  - test/dummy/config/spring.rb
240
252
  - test/dummy/config.ru
241
253
  - test/dummy/db/development.sqlite3
242
- - test/dummy/db/migrate/20140714223034_devise_token_auth_create_users.rb
254
+ - test/dummy/db/migrate/20140715061447_devise_token_auth_create_users.rb
255
+ - test/dummy/db/migrate/20140715061805_devise_token_auth_create_mangs.rb
243
256
  - test/dummy/db/schema.rb
244
257
  - test/dummy/db/test.sqlite3
245
258
  - test/dummy/log/development.log
@@ -251,6 +264,7 @@ test_files:
251
264
  - test/dummy/Rakefile
252
265
  - test/dummy/README.rdoc
253
266
  - test/dummy/tmp/restart.txt
267
+ - test/fixtures/mangs.yml
254
268
  - test/fixtures/users.yml
255
269
  - test/integration/navigation_test.rb
256
270
  - test/lib/generators/devise_token_auth/install_generator_test.rb