devise-authy 1.0.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. data/Gemfile +3 -1
  2. data/Gemfile.lock +90 -62
  3. data/Rakefile +1 -1
  4. data/VERSION +1 -1
  5. data/app/controllers/devise/devise_authy_controller.rb +23 -5
  6. data/app/views/devise/enable_authy.html.erb +2 -3
  7. data/app/views/devise/enable_authy.html.haml +2 -5
  8. data/app/views/devise/verify_authy.html.erb +5 -0
  9. data/app/views/devise/verify_authy.html.haml +3 -0
  10. data/authy-devise-demo/Gemfile +1 -0
  11. data/authy-devise-demo/Gemfile.lock +12 -3
  12. data/authy-devise-demo/app/views/devise/devise_authy/enable_authy.html.erb +2 -3
  13. data/authy-devise-demo/app/views/devise/devise_authy/verify_authy.html.erb +5 -0
  14. data/authy-devise-demo/app/views/layouts/application.html.erb +14 -2
  15. data/authy-devise-demo/config/initializers/devise.rb +7 -2
  16. data/authy-devise-demo/config/locales/devise.authy.en.yml +4 -1
  17. data/config/locales/en.yml +4 -1
  18. data/devise-authy.gemspec +62 -51
  19. data/lib/devise-authy.rb +3 -0
  20. data/lib/devise-authy/controllers/helpers.rb +40 -17
  21. data/lib/devise-authy/models/authy_authenticatable.rb +2 -0
  22. data/lib/generators/devise_authy/install_generator.rb +10 -3
  23. data/spec/controllers/devise_authy_controller_spec.rb +134 -45
  24. data/spec/features/authy_authenticatable_spec.rb +95 -0
  25. data/spec/generators_spec.rb +12 -6
  26. data/spec/orm/active_record.rb +1 -1
  27. data/spec/rails-app/Gemfile +8 -0
  28. data/spec/rails-app/Gemfile.lock +111 -0
  29. data/spec/{rails_app → rails-app}/Rakefile +2 -5
  30. data/spec/{rails_app → rails-app}/app/assets/images/rails.png +0 -0
  31. data/spec/rails-app/app/assets/javascripts/application.js +15 -0
  32. data/spec/rails-app/app/assets/javascripts/devise_authy.js +7 -0
  33. data/spec/rails-app/app/assets/javascripts/welcome.js +2 -0
  34. data/spec/rails-app/app/assets/stylesheets/application.css +13 -0
  35. data/spec/{rails_app → rails-app}/app/assets/stylesheets/devise_authy.css +0 -0
  36. data/spec/rails-app/app/assets/stylesheets/welcome.css.scss +3 -0
  37. data/spec/{rails_app → rails-app}/app/controllers/application_controller.rb +0 -1
  38. data/spec/rails-app/app/controllers/welcome_controller.rb +6 -0
  39. data/spec/{rails_app → rails-app}/app/helpers/application_helper.rb +0 -0
  40. data/spec/rails-app/app/helpers/welcome_helper.rb +2 -0
  41. data/spec/{rails_app → rails-app}/app/mailers/.gitkeep +0 -0
  42. data/spec/{rails_app → rails-app}/app/models/.gitkeep +0 -0
  43. data/spec/{rails_app → rails-app}/app/models/user.rb +4 -2
  44. data/spec/{rails_app/app/views/devise/devise_authy/register.html.erb → rails-app/app/views/devise/devise_authy/enable_authy.html.erb} +4 -6
  45. data/spec/rails-app/app/views/devise/devise_authy/verify_authy.html.erb +13 -0
  46. data/spec/rails-app/app/views/devise/devise_authy/verify_authy_installation.html.erb +10 -0
  47. data/spec/rails-app/app/views/layouts/application.html.erb +29 -0
  48. data/spec/rails-app/app/views/welcome/index.html.erb +5 -0
  49. data/spec/{rails_app → rails-app}/config.ru +0 -0
  50. data/spec/{rails_app → rails-app}/config/application.rb +18 -2
  51. data/spec/rails-app/config/boot.rb +6 -0
  52. data/spec/{rails_app → rails-app}/config/database.yml +6 -3
  53. data/spec/{rails_app → rails-app}/config/environment.rb +0 -0
  54. data/spec/{rails_app → rails-app}/config/environments/development.rb +2 -0
  55. data/spec/{rails_app → rails-app}/config/environments/production.rb +0 -0
  56. data/spec/{rails_app → rails-app}/config/environments/test.rb +0 -0
  57. data/spec/rails-app/config/initializers/authy.rb +2 -0
  58. data/spec/{rails_app → rails-app}/config/initializers/backtrace_silencers.rb +0 -0
  59. data/spec/{rails_app → rails-app}/config/initializers/devise.rb +13 -5
  60. data/spec/{rails_app → rails-app}/config/initializers/inflections.rb +5 -0
  61. data/spec/{rails_app → rails-app}/config/initializers/mime_types.rb +0 -0
  62. data/spec/{rails_app → rails-app}/config/initializers/secret_token.rb +1 -1
  63. data/spec/{rails_app → rails-app}/config/initializers/session_store.rb +2 -2
  64. data/spec/{rails_app → rails-app}/config/initializers/wrap_parameters.rb +0 -0
  65. data/spec/{rails_app → rails-app}/config/locales/devise.authy.en.yml +7 -2
  66. data/spec/rails-app/config/locales/devise.en.yml +59 -0
  67. data/spec/rails-app/config/locales/en.yml +5 -0
  68. data/spec/{rails_app → rails-app}/config/routes.rb +3 -2
  69. data/spec/rails-app/db/development.sqlite3 +0 -0
  70. data/spec/{rails_app/db/migrate/20121029205626_devise_create_users.rb → rails-app/db/migrate/20130419164907_devise_create_users.rb} +15 -1
  71. data/spec/{rails_app/db/migrate/20121029205628_devise_authy_add_to_users.rb → rails-app/db/migrate/20130419164936_devise_authy_add_to_users.rb} +5 -2
  72. data/spec/{rails_app → rails-app}/db/schema.rb +7 -12
  73. data/spec/rails-app/db/seeds.rb +7 -0
  74. data/spec/rails-app/lib/assets/.gitkeep +0 -0
  75. data/spec/rails-app/lib/tasks/.gitkeep +0 -0
  76. data/spec/rails-app/public/404.html +26 -0
  77. data/spec/rails-app/public/422.html +26 -0
  78. data/spec/rails-app/public/500.html +25 -0
  79. data/spec/rails-app/public/favicon.ico +0 -0
  80. data/spec/rails-app/public/robots.txt +5 -0
  81. data/spec/{rails_app → rails-app}/script/rails +0 -0
  82. data/spec/routing/routes_spec.rb +20 -8
  83. data/spec/spec_helper.rb +1 -2
  84. data/spec/support/helpers.rb +6 -1
  85. metadata +86 -62
  86. data/spec/integration/authy_authenticatable.rb +0 -88
  87. data/spec/rails_app/app/assets/javascripts/application.js +0 -10
  88. data/spec/rails_app/app/assets/stylesheets/application.css +0 -9
  89. data/spec/rails_app/app/assets/stylesheets/devise_authy.css.scss +0 -26
  90. data/spec/rails_app/app/assets/stylesheets/scaffolds.css.scss +0 -56
  91. data/spec/rails_app/app/controllers/posts_controller.rb +0 -83
  92. data/spec/rails_app/app/helpers/posts_helper.rb +0 -2
  93. data/spec/rails_app/app/models/post.rb +0 -2
  94. data/spec/rails_app/app/views/devise/devise_authy/show.html.erb +0 -10
  95. data/spec/rails_app/app/views/layouts/application.html.erb +0 -24
  96. data/spec/rails_app/app/views/posts/_form.html.erb +0 -25
  97. data/spec/rails_app/app/views/posts/edit.html.erb +0 -6
  98. data/spec/rails_app/app/views/posts/index.html.erb +0 -27
  99. data/spec/rails_app/app/views/posts/new.html.erb +0 -5
  100. data/spec/rails_app/app/views/posts/show.html.erb +0 -15
  101. data/spec/rails_app/config/boot.rb +0 -7
  102. data/spec/rails_app/config/initializers/authy.rb +0 -3
  103. data/spec/rails_app/db/migrate/20121029205627_create_posts.rb +0 -10
  104. data/spec/rails_app/public/favicon.ico +0 -0
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
File without changes
@@ -1,19 +1,31 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "routes for devise_authy" do
4
- it "route to devise_authy#show" do
5
- get('/users/devise_authy').should route_to("devise/devise_authy#show")
4
+ it "route to devise_authy#GET_verify_authy" do
5
+ get('/users/verify_authy').should route_to("devise/devise_authy#GET_verify_authy")
6
6
  end
7
7
 
8
- it "routes to devise_authy#create" do
9
- post('/users/devise_authy').should route_to("devise/devise_authy#create")
8
+ it "routes to devise_authy#POST_verify_authy" do
9
+ post('/users/verify_authy').should route_to("devise/devise_authy#POST_verify_authy")
10
10
  end
11
11
 
12
- it "routes to devise_authy#update" do
13
- put('/users/devise_authy').should route_to("devise/devise_authy#update")
12
+ it "routes to devise_authy#GET_enable_authy" do
13
+ get('/users/enable_authy').should route_to("devise/devise_authy#GET_enable_authy")
14
14
  end
15
15
 
16
- it "map enable two factor authentication" do
17
- get('/users/enable_authy').should route_to("devise/devise_authy#register")
16
+ it "routes to devise_authy#POST_enable_authy" do
17
+ post('/users/enable_authy').should route_to("devise/devise_authy#POST_enable_authy")
18
+ end
19
+
20
+ it "route to devise_authy#GET_verify_authy_installation" do
21
+ get('/users/verify_authy_installation').should route_to("devise/devise_authy#GET_verify_authy_installation")
22
+ end
23
+
24
+ it "routes to devise_authy#POST_verify_authy_installation" do
25
+ post('/users/verify_authy_installation').should route_to("devise/devise_authy#POST_verify_authy_installation")
26
+ end
27
+
28
+ it "routes to devise_authy#request_sms" do
29
+ post('/users/request-sms').should route_to("devise/devise_authy#request_sms")
18
30
  end
19
31
  end
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  ENV["RAILS_ENV"] ||= 'test'
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  $LOAD_PATH.unshift(File.dirname(__FILE__))
4
- require "rails_app/config/environment"
5
4
 
5
+ require "rails-app/config/environment"
6
6
  require 'rspec/rails'
7
7
  require 'devise-authy'
8
8
  require 'orm/active_record'
@@ -17,7 +17,6 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
17
17
  RSpec.configure do |config|
18
18
  config.before :suite do
19
19
  DatabaseCleaner[:active_record].strategy = :truncation
20
- Capybara.run_server = false
21
20
  end
22
21
 
23
22
  config.before :each do
@@ -25,4 +25,9 @@ def fill_sign_in_form(email, password)
25
25
  fill_in 'Password', :with => password
26
26
  end
27
27
  click_on 'Sign in'
28
- end
28
+ end
29
+
30
+ def sign_cookie(name, val)
31
+ verifier = ActiveSupport::MessageVerifier.new(RailsApp::Application.config.secret_token)
32
+ verifier.generate(val)
33
+ end
metadata CHANGED
@@ -2,17 +2,16 @@
2
2
  name: devise-authy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.0
5
+ version: 1.2.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Authy Inc.
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-10 00:00:00.000000000 Z
12
+ date: 2013-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- type: :runtime
16
15
  version_requirements: !ruby/object:Gem::Requirement
17
16
  none: false
18
17
  requirements:
@@ -20,6 +19,7 @@ dependencies:
20
19
  - !ruby/object:Gem::Version
21
20
  version: '0'
22
21
  name: devise
22
+ type: :runtime
23
23
  prerelease: false
24
24
  requirement: !ruby/object:Gem::Requirement
25
25
  none: false
@@ -28,7 +28,6 @@ dependencies:
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
- type: :runtime
32
31
  version_requirements: !ruby/object:Gem::Requirement
33
32
  none: false
34
33
  requirements:
@@ -36,6 +35,7 @@ dependencies:
36
35
  - !ruby/object:Gem::Version
37
36
  version: '0'
38
37
  name: authy
38
+ type: :runtime
39
39
  prerelease: false
40
40
  requirement: !ruby/object:Gem::Requirement
41
41
  none: false
@@ -44,7 +44,6 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
- type: :development
48
47
  version_requirements: !ruby/object:Gem::Requirement
49
48
  none: false
50
49
  requirements:
@@ -52,6 +51,7 @@ dependencies:
52
51
  - !ruby/object:Gem::Version
53
52
  version: '0'
54
53
  name: rspec
54
+ type: :development
55
55
  prerelease: false
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  none: false
@@ -60,7 +60,6 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  - !ruby/object:Gem::Dependency
63
- type: :development
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  none: false
66
65
  requirements:
@@ -68,6 +67,7 @@ dependencies:
68
67
  - !ruby/object:Gem::Version
69
68
  version: '0'
70
69
  name: yard
70
+ type: :development
71
71
  prerelease: false
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  none: false
@@ -76,7 +76,6 @@ dependencies:
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
- type: :development
80
79
  version_requirements: !ruby/object:Gem::Requirement
81
80
  none: false
82
81
  requirements:
@@ -84,6 +83,7 @@ dependencies:
84
83
  - !ruby/object:Gem::Version
85
84
  version: '0'
86
85
  name: rdoc
86
+ type: :development
87
87
  prerelease: false
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  none: false
@@ -92,7 +92,6 @@ dependencies:
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  - !ruby/object:Gem::Dependency
95
- type: :development
96
95
  version_requirements: !ruby/object:Gem::Requirement
97
96
  none: false
98
97
  requirements:
@@ -100,6 +99,7 @@ dependencies:
100
99
  - !ruby/object:Gem::Version
101
100
  version: '0'
102
101
  name: bundler
102
+ type: :development
103
103
  prerelease: false
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  none: false
@@ -108,7 +108,6 @@ dependencies:
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
- type: :development
112
111
  version_requirements: !ruby/object:Gem::Requirement
113
112
  none: false
114
113
  requirements:
@@ -116,6 +115,7 @@ dependencies:
116
115
  - !ruby/object:Gem::Version
117
116
  version: '0'
118
117
  name: jeweler
118
+ type: :development
119
119
  prerelease: false
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  none: false
@@ -124,7 +124,6 @@ dependencies:
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  - !ruby/object:Gem::Dependency
127
- type: :development
128
127
  version_requirements: !ruby/object:Gem::Requirement
129
128
  none: false
130
129
  requirements:
@@ -132,6 +131,7 @@ dependencies:
132
131
  - !ruby/object:Gem::Version
133
132
  version: '0'
134
133
  name: simplecov
134
+ type: :development
135
135
  prerelease: false
136
136
  requirement: !ruby/object:Gem::Requirement
137
137
  none: false
@@ -140,7 +140,6 @@ dependencies:
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  - !ruby/object:Gem::Dependency
143
- type: :development
144
143
  version_requirements: !ruby/object:Gem::Requirement
145
144
  none: false
146
145
  requirements:
@@ -148,6 +147,7 @@ dependencies:
148
147
  - !ruby/object:Gem::Version
149
148
  version: '0'
150
149
  name: sass-rails
150
+ type: :development
151
151
  prerelease: false
152
152
  requirement: !ruby/object:Gem::Requirement
153
153
  none: false
@@ -156,7 +156,6 @@ dependencies:
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  - !ruby/object:Gem::Dependency
159
- type: :development
160
159
  version_requirements: !ruby/object:Gem::Requirement
161
160
  none: false
162
161
  requirements:
@@ -164,6 +163,23 @@ dependencies:
164
163
  - !ruby/object:Gem::Version
165
164
  version: '0'
166
165
  name: jquery-rails
166
+ type: :development
167
+ prerelease: false
168
+ requirement: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ none: false
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ name: pry
182
+ type: :development
167
183
  prerelease: false
168
184
  requirement: !ruby/object:Gem::Requirement
169
185
  none: false
@@ -282,61 +298,69 @@ files:
282
298
  - lib/generators/devise_authy/devise_authy_generator.rb
283
299
  - lib/generators/devise_authy/install_generator.rb
284
300
  - spec/controllers/devise_authy_controller_spec.rb
301
+ - spec/features/authy_authenticatable_spec.rb
285
302
  - spec/generators_spec.rb
286
- - spec/integration/authy_authenticatable.rb
287
303
  - spec/models/authy_authenticatable.rb
288
304
  - spec/orm/active_record.rb
289
- - spec/rails_app/Rakefile
290
- - spec/rails_app/app/assets/images/rails.png
291
- - spec/rails_app/app/assets/javascripts/application.js
292
- - spec/rails_app/app/assets/stylesheets/application.css
293
- - spec/rails_app/app/assets/stylesheets/devise_authy.css
294
- - spec/rails_app/app/assets/stylesheets/devise_authy.css.scss
295
- - spec/rails_app/app/assets/stylesheets/scaffolds.css.scss
296
- - spec/rails_app/app/controllers/application_controller.rb
297
- - spec/rails_app/app/controllers/posts_controller.rb
298
- - spec/rails_app/app/helpers/application_helper.rb
299
- - spec/rails_app/app/helpers/posts_helper.rb
300
- - spec/rails_app/app/mailers/.gitkeep
301
- - spec/rails_app/app/models/.gitkeep
302
- - spec/rails_app/app/models/post.rb
303
- - spec/rails_app/app/models/user.rb
304
- - spec/rails_app/app/views/devise/devise_authy/register.html.erb
305
- - spec/rails_app/app/views/devise/devise_authy/show.html.erb
306
- - spec/rails_app/app/views/layouts/application.html.erb
307
- - spec/rails_app/app/views/posts/_form.html.erb
308
- - spec/rails_app/app/views/posts/edit.html.erb
309
- - spec/rails_app/app/views/posts/index.html.erb
310
- - spec/rails_app/app/views/posts/new.html.erb
311
- - spec/rails_app/app/views/posts/show.html.erb
312
- - spec/rails_app/config.ru
313
- - spec/rails_app/config/application.rb
314
- - spec/rails_app/config/boot.rb
315
- - spec/rails_app/config/database.yml
316
- - spec/rails_app/config/environment.rb
317
- - spec/rails_app/config/environments/development.rb
318
- - spec/rails_app/config/environments/production.rb
319
- - spec/rails_app/config/environments/test.rb
320
- - spec/rails_app/config/initializers/authy.rb
321
- - spec/rails_app/config/initializers/backtrace_silencers.rb
322
- - spec/rails_app/config/initializers/devise.rb
323
- - spec/rails_app/config/initializers/inflections.rb
324
- - spec/rails_app/config/initializers/mime_types.rb
325
- - spec/rails_app/config/initializers/secret_token.rb
326
- - spec/rails_app/config/initializers/session_store.rb
327
- - spec/rails_app/config/initializers/wrap_parameters.rb
328
- - spec/rails_app/config/locales/devise.authy.en.yml
329
- - spec/rails_app/config/routes.rb
330
- - spec/rails_app/db/migrate/20121029205626_devise_create_users.rb
331
- - spec/rails_app/db/migrate/20121029205627_create_posts.rb
332
- - spec/rails_app/db/migrate/20121029205628_devise_authy_add_to_users.rb
333
- - spec/rails_app/db/schema.rb
334
- - spec/rails_app/public/favicon.ico
335
- - spec/rails_app/script/rails
305
+ - spec/rails-app/Gemfile
306
+ - spec/rails-app/Gemfile.lock
307
+ - spec/rails-app/Rakefile
308
+ - spec/rails-app/app/assets/images/rails.png
309
+ - spec/rails-app/app/assets/javascripts/application.js
310
+ - spec/rails-app/app/assets/javascripts/devise_authy.js
311
+ - spec/rails-app/app/assets/javascripts/welcome.js
312
+ - spec/rails-app/app/assets/stylesheets/application.css
313
+ - spec/rails-app/app/assets/stylesheets/devise_authy.css
314
+ - spec/rails-app/app/assets/stylesheets/welcome.css.scss
315
+ - spec/rails-app/app/controllers/application_controller.rb
316
+ - spec/rails-app/app/controllers/welcome_controller.rb
317
+ - spec/rails-app/app/helpers/application_helper.rb
318
+ - spec/rails-app/app/helpers/welcome_helper.rb
319
+ - spec/rails-app/app/mailers/.gitkeep
320
+ - spec/rails-app/app/models/.gitkeep
321
+ - spec/rails-app/app/models/user.rb
322
+ - spec/rails-app/app/views/devise/devise_authy/enable_authy.html.erb
323
+ - spec/rails-app/app/views/devise/devise_authy/verify_authy.html.erb
324
+ - spec/rails-app/app/views/devise/devise_authy/verify_authy_installation.html.erb
325
+ - spec/rails-app/app/views/layouts/application.html.erb
326
+ - spec/rails-app/app/views/welcome/index.html.erb
327
+ - spec/rails-app/config.ru
328
+ - spec/rails-app/config/application.rb
329
+ - spec/rails-app/config/boot.rb
330
+ - spec/rails-app/config/database.yml
331
+ - spec/rails-app/config/environment.rb
332
+ - spec/rails-app/config/environments/development.rb
333
+ - spec/rails-app/config/environments/production.rb
334
+ - spec/rails-app/config/environments/test.rb
335
+ - spec/rails-app/config/initializers/authy.rb
336
+ - spec/rails-app/config/initializers/backtrace_silencers.rb
337
+ - spec/rails-app/config/initializers/devise.rb
338
+ - spec/rails-app/config/initializers/inflections.rb
339
+ - spec/rails-app/config/initializers/mime_types.rb
340
+ - spec/rails-app/config/initializers/secret_token.rb
341
+ - spec/rails-app/config/initializers/session_store.rb
342
+ - spec/rails-app/config/initializers/wrap_parameters.rb
343
+ - spec/rails-app/config/locales/devise.authy.en.yml
344
+ - spec/rails-app/config/locales/devise.en.yml
345
+ - spec/rails-app/config/locales/en.yml
346
+ - spec/rails-app/config/routes.rb
347
+ - spec/rails-app/db/development.sqlite3
348
+ - spec/rails-app/db/migrate/20130419164907_devise_create_users.rb
349
+ - spec/rails-app/db/migrate/20130419164936_devise_authy_add_to_users.rb
350
+ - spec/rails-app/db/schema.rb
351
+ - spec/rails-app/db/seeds.rb
352
+ - spec/rails-app/lib/assets/.gitkeep
353
+ - spec/rails-app/lib/tasks/.gitkeep
354
+ - spec/rails-app/public/404.html
355
+ - spec/rails-app/public/422.html
356
+ - spec/rails-app/public/500.html
357
+ - spec/rails-app/public/favicon.ico
358
+ - spec/rails-app/public/robots.txt
359
+ - spec/rails-app/script/rails
336
360
  - spec/routing/routes_spec.rb
337
361
  - spec/spec_helper.rb
338
362
  - spec/support/helpers.rb
339
- homepage: http://github.com/senekis/devise-authy
363
+ homepage: https://github.com/authy/authy-devise
340
364
  licenses:
341
365
  - MIT
342
366
  post_install_message:
@@ -350,7 +374,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
350
374
  - !ruby/object:Gem::Version
351
375
  segments:
352
376
  - 0
353
- hash: 1511880933164397390
377
+ hash: 2657073351252214924
354
378
  version: '0'
355
379
  required_rubygems_version: !ruby/object:Gem::Requirement
356
380
  none: false
@@ -1,88 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Authy Autnenticatable", :type => :request do
4
- describe "If user don't have two factor authentication should login with email - password" do
5
- before :each do
6
- @user = create_user(:email => 'foo@bar.com')
7
- end
8
-
9
- it "Sign in should succeed" do
10
- fill_sign_in_form('foo@bar.com', '12345678')
11
- current_path.should == root_path
12
- page.should have_content('Signed in successfully.')
13
- end
14
-
15
- it "Sign in shouldn't success" do
16
- fill_sign_in_form('foo@bar.com', '14567823')
17
- current_path.should == new_user_session_path
18
- page.should_not have_content('Signed in successfully.')
19
- end
20
- end
21
-
22
- describe "If user have two factor authentication" do
23
- before :each do
24
- @user = create_user(:authy_id => '90')
25
- end
26
-
27
- describe "Without cookie['authy_authentication']" do
28
- it "Sign in should succeed" do
29
- authy_response = mock('authy_response', :ok? => true)
30
- Authy::API.should_receive(:verify).with(:id => '90', :token => '324567').and_return(authy_response)
31
-
32
- visit new_user_session_path
33
- fill_sign_in_form(@user.email, '12345678')
34
- current_path.should == user_devise_authy_path
35
- page.should have_content('Please enter your Authy token')
36
-
37
- within('#devise_authy') do
38
- fill_in 'authy-token', :with => '324567'
39
- end
40
- click_on 'Check Token'
41
- current_path.should == root_path
42
- page.should have_content(I18n.t('devise.devise_authy.user.signed_in'))
43
- @user.reload
44
- @user.last_sign_in_with_authy.should_not be_nil
45
- end
46
-
47
- it "Sign in shouldn't success" do
48
- authy_response = mock('authy_response', :ok? => false)
49
- Authy::API.should_receive(:verify).with(:id => '90', :token => '324567').and_return(authy_response)
50
-
51
- visit new_user_session_path
52
- fill_sign_in_form(@user.email, '12345678')
53
- current_path.should == user_devise_authy_path
54
- page.should have_content('Please enter your Authy token')
55
-
56
- within('#devise_authy') do
57
- fill_in 'authy-token', :with => '324567'
58
- end
59
- click_on 'Check Token'
60
- current_path.should == new_user_session_path
61
- @user.reload
62
- @user.last_sign_in_with_authy.should be_nil
63
- end
64
- end
65
-
66
- it "With cookie['authy_authentication'] and last_sign_in_with_authy less than one month shouldn't show the request token view" do
67
- page.driver.browser.set_cookie('authy_authentication=true')
68
- @user.last_sign_in_with_authy = 2.days.ago
69
- @user.save
70
- @user.reload
71
-
72
- visit new_user_session_path
73
- fill_sign_in_form(@user.email, '12345678')
74
- current_path.should == root_path
75
- end
76
-
77
- it "With cookie['authy_authentication'] and last_sign_in_with_authy greater than one month should Show the request token view" do
78
- page.driver.browser.set_cookie('authy_authentication=true')
79
- @user.last_sign_in_with_authy = 2.months.ago
80
- @user.save
81
- @user.reload
82
-
83
- visit new_user_session_path
84
- fill_sign_in_form(@user.email, '12345678')
85
- current_path.should == user_devise_authy_path
86
- end
87
- end
88
- end