current_user 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,23 @@ class LoginTest < ActionDispatch::IntegrationTest
22
22
  assert_user_sees_unauthorized_error
23
23
  end
24
24
 
25
- test "invalide key" do
25
+ test "stored location" do
26
+ visit '/my_another_protected_page'
27
+ assert_user_sees_unauthorized_error
28
+ sign_in
29
+ assert page.has_content?("My another protected page"), 'Redirects to the stored location'
30
+ end
31
+
32
+ test "erasing the previous stored location" do
33
+ visit '/my_another_protected_page'
34
+ sign_in
35
+ assert page.has_content?("My another protected page"), 'Redirects to the stored location'
36
+
37
+ sign_in
38
+ assert page.has_content?("My protected page"), 'Redirects to the default root url'
39
+ end
40
+
41
+ test "invalid key" do
26
42
  invalid_key = '54321'
27
43
  visit sing_in_page_path(invalid_key)
28
44
  assert_user_sees_unauthorized_error
@@ -45,7 +61,6 @@ class LoginTest < ActionDispatch::IntegrationTest
45
61
  assert_user_sees_unauthorized_error
46
62
  end
47
63
 
48
- test "helper methods in views" do end
49
64
  test "all users in the application database are listed in the signin page" do end
50
65
  end
51
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: current_user
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,27 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2013-02-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &68600560 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 3.2.6
21
+ version: '3.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *68600560
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '3.2'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: sqlite3
27
- requirement: &68600230 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *68600230
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: capybara
38
- requirement: &68599920 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *68599920
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: database_cleaner
49
- requirement: &68599500 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,7 +69,44 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *68599500
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: cucumber
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: aruba
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
58
110
  description: ! 'An authentication gem for the pre-production (mainly) phase of the
59
111
  application lifecycle.
60
112
 
@@ -70,75 +122,79 @@ extensions: []
70
122
  extra_rdoc_files:
71
123
  - README.md
72
124
  files:
125
+ - app/helpers/current_user/application_helper.rb
73
126
  - app/assets/stylesheets/current_user/application.css
74
- - app/views/layouts/current_user/application.html.erb
75
- - app/views/current_user/sessions/new.html.erb
76
127
  - app/controllers/current_user/application_controller.rb
77
128
  - app/controllers/current_user/sessions_controller.rb
78
- - app/helpers/current_user/application_helper.rb
129
+ - app/views/layouts/current_user/application.html.erb
130
+ - app/views/current_user/sessions/_user.html.erb
131
+ - app/views/current_user/sessions/new.html.erb
132
+ - app/views/current_user/sessions/_header.html.erb
133
+ - app/views/current_user/sessions/_add_users_message.html.erb
79
134
  - config/routes.rb
80
135
  - config/initializers/extend_controllers.rb
81
136
  - lib/current_user.rb
82
- - lib/generators/current_user/install_generator.rb
83
- - lib/generators/templates/current_user.rb
84
- - lib/generators/templates/README
85
137
  - lib/tasks/current_user_tasks.rake
86
138
  - lib/current_user/version.rb
87
- - lib/current_user/constants.rb
88
139
  - lib/current_user/controller/helpers.rb
89
140
  - lib/current_user/engine.rb
141
+ - lib/current_user/constants.rb
142
+ - lib/generators/templates/current_user.rb
143
+ - lib/generators/templates/README
144
+ - lib/generators/current_user/install_generator.rb
90
145
  - MIT-LICENSE
91
146
  - Rakefile
92
147
  - README.md
93
- - test/dummy/test/fixtures/users.yml
94
- - test/dummy/tmp/pids/server.pid
148
+ - test/integration_test_helper.rb
149
+ - test/support/current_user/navigation_helper.rb
150
+ - test/test_helper.rb
151
+ - test/dummy/public/favicon.ico
152
+ - test/dummy/public/422.html
153
+ - test/dummy/public/404.html
154
+ - test/dummy/public/500.html
95
155
  - test/dummy/config.ru
96
- - test/dummy/log/development.log
97
- - test/dummy/log/test.log
98
156
  - test/dummy/app/models/user.rb
157
+ - test/dummy/app/helpers/application_helper.rb
99
158
  - test/dummy/app/assets/stylesheets/application.css
100
159
  - test/dummy/app/assets/javascripts/application.js
160
+ - test/dummy/app/controllers/application_controller.rb
161
+ - test/dummy/app/controllers/my_protected_pages_controller.rb
162
+ - test/dummy/app/controllers/helpers_controller.rb
163
+ - test/dummy/app/controllers/my_another_protected_pages_controller.rb
101
164
  - test/dummy/app/views/layouts/application.html.erb
102
- - test/dummy/app/views/helpers/current_user_helper.erb
103
165
  - test/dummy/app/views/helpers/signed_in_helper.erb
166
+ - test/dummy/app/views/helpers/current_user_helper.erb
104
167
  - test/dummy/app/views/my_protected_pages/show.html.erb
105
- - test/dummy/app/controllers/application_controller.rb
106
- - test/dummy/app/controllers/helpers_controller.rb
107
- - test/dummy/app/controllers/my_protected_pages_controller.rb
108
- - test/dummy/app/helpers/application_helper.rb
109
- - test/dummy/config/environments/test.rb
110
- - test/dummy/config/environments/production.rb
111
- - test/dummy/config/environments/development.rb
168
+ - test/dummy/app/views/my_another_protected_pages/show.html.erb
169
+ - test/dummy/test/fixtures/users.yml
170
+ - test/dummy/README.rdoc
171
+ - test/dummy/config/environment.rb
112
172
  - test/dummy/config/locales/en.yml
113
- - test/dummy/config/application.rb
114
- - test/dummy/config/boot.rb
115
173
  - test/dummy/config/routes.rb
116
- - test/dummy/config/environment.rb
117
- - test/dummy/config/initializers/backtrace_silencers.rb
118
- - test/dummy/config/initializers/mime_types.rb
119
- - test/dummy/config/initializers/current_user.rb
120
174
  - test/dummy/config/initializers/secret_token.rb
121
- - test/dummy/config/initializers/session_store.rb
175
+ - test/dummy/config/initializers/current_user.rb
176
+ - test/dummy/config/initializers/mime_types.rb
122
177
  - test/dummy/config/initializers/inflections.rb
178
+ - test/dummy/config/initializers/session_store.rb
123
179
  - test/dummy/config/initializers/wrap_parameters.rb
180
+ - test/dummy/config/initializers/backtrace_silencers.rb
124
181
  - test/dummy/config/database.yml
125
182
  - test/dummy/config/current_user/key
126
- - test/dummy/Rakefile
183
+ - test/dummy/config/environments/production.rb
184
+ - test/dummy/config/environments/development.rb
185
+ - test/dummy/config/environments/test.rb
186
+ - test/dummy/config/boot.rb
187
+ - test/dummy/config/application.rb
188
+ - test/dummy/log/development.log
189
+ - test/dummy/log/test.log
127
190
  - test/dummy/db/development.sqlite3
128
- - test/dummy/db/test.sqlite3
129
- - test/dummy/db/migrate/20120319094037_create_users.rb
191
+ - test/dummy/db/migrate/20120630130539_create_users.rb
130
192
  - test/dummy/db/schema.rb
131
- - test/dummy/public/422.html
132
- - test/dummy/public/500.html
133
- - test/dummy/public/404.html
134
- - test/dummy/public/favicon.ico
135
- - test/dummy/README.rdoc
193
+ - test/dummy/db/test.sqlite3
136
194
  - test/dummy/script/rails
137
- - test/integration_test_helper.rb
195
+ - test/dummy/Rakefile
138
196
  - test/integration/helpers_test.rb
139
197
  - test/integration/login_test.rb
140
- - test/support/current_user/navigation_helper.rb
141
- - test/test_helper.rb
142
198
  homepage: https://github.com/MitinPavel/current_user
143
199
  licenses: []
144
200
  post_install_message:
@@ -159,57 +215,58 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
215
  version: '0'
160
216
  requirements: []
161
217
  rubyforge_project:
162
- rubygems_version: 1.8.6
218
+ rubygems_version: 1.8.25
163
219
  signing_key:
164
220
  specification_version: 3
165
221
  summary: Dev phase auth for Rails
166
222
  test_files:
167
- - test/dummy/test/fixtures/users.yml
168
- - test/dummy/tmp/pids/server.pid
223
+ - test/integration_test_helper.rb
224
+ - test/support/current_user/navigation_helper.rb
225
+ - test/test_helper.rb
226
+ - test/dummy/public/favicon.ico
227
+ - test/dummy/public/422.html
228
+ - test/dummy/public/404.html
229
+ - test/dummy/public/500.html
169
230
  - test/dummy/config.ru
170
- - test/dummy/log/development.log
171
- - test/dummy/log/test.log
172
231
  - test/dummy/app/models/user.rb
232
+ - test/dummy/app/helpers/application_helper.rb
173
233
  - test/dummy/app/assets/stylesheets/application.css
174
234
  - test/dummy/app/assets/javascripts/application.js
235
+ - test/dummy/app/controllers/application_controller.rb
236
+ - test/dummy/app/controllers/my_protected_pages_controller.rb
237
+ - test/dummy/app/controllers/helpers_controller.rb
238
+ - test/dummy/app/controllers/my_another_protected_pages_controller.rb
175
239
  - test/dummy/app/views/layouts/application.html.erb
176
- - test/dummy/app/views/helpers/current_user_helper.erb
177
240
  - test/dummy/app/views/helpers/signed_in_helper.erb
241
+ - test/dummy/app/views/helpers/current_user_helper.erb
178
242
  - test/dummy/app/views/my_protected_pages/show.html.erb
179
- - test/dummy/app/controllers/application_controller.rb
180
- - test/dummy/app/controllers/helpers_controller.rb
181
- - test/dummy/app/controllers/my_protected_pages_controller.rb
182
- - test/dummy/app/helpers/application_helper.rb
183
- - test/dummy/config/environments/test.rb
184
- - test/dummy/config/environments/production.rb
185
- - test/dummy/config/environments/development.rb
243
+ - test/dummy/app/views/my_another_protected_pages/show.html.erb
244
+ - test/dummy/test/fixtures/users.yml
245
+ - test/dummy/README.rdoc
246
+ - test/dummy/config/environment.rb
186
247
  - test/dummy/config/locales/en.yml
187
- - test/dummy/config/application.rb
188
- - test/dummy/config/boot.rb
189
248
  - test/dummy/config/routes.rb
190
- - test/dummy/config/environment.rb
191
- - test/dummy/config/initializers/backtrace_silencers.rb
192
- - test/dummy/config/initializers/mime_types.rb
193
- - test/dummy/config/initializers/current_user.rb
194
249
  - test/dummy/config/initializers/secret_token.rb
195
- - test/dummy/config/initializers/session_store.rb
250
+ - test/dummy/config/initializers/current_user.rb
251
+ - test/dummy/config/initializers/mime_types.rb
196
252
  - test/dummy/config/initializers/inflections.rb
253
+ - test/dummy/config/initializers/session_store.rb
197
254
  - test/dummy/config/initializers/wrap_parameters.rb
255
+ - test/dummy/config/initializers/backtrace_silencers.rb
198
256
  - test/dummy/config/database.yml
199
257
  - test/dummy/config/current_user/key
200
- - test/dummy/Rakefile
258
+ - test/dummy/config/environments/production.rb
259
+ - test/dummy/config/environments/development.rb
260
+ - test/dummy/config/environments/test.rb
261
+ - test/dummy/config/boot.rb
262
+ - test/dummy/config/application.rb
263
+ - test/dummy/log/development.log
264
+ - test/dummy/log/test.log
201
265
  - test/dummy/db/development.sqlite3
202
- - test/dummy/db/test.sqlite3
203
- - test/dummy/db/migrate/20120319094037_create_users.rb
266
+ - test/dummy/db/migrate/20120630130539_create_users.rb
204
267
  - test/dummy/db/schema.rb
205
- - test/dummy/public/422.html
206
- - test/dummy/public/500.html
207
- - test/dummy/public/404.html
208
- - test/dummy/public/favicon.ico
209
- - test/dummy/README.rdoc
268
+ - test/dummy/db/test.sqlite3
210
269
  - test/dummy/script/rails
211
- - test/integration_test_helper.rb
270
+ - test/dummy/Rakefile
212
271
  - test/integration/helpers_test.rb
213
272
  - test/integration/login_test.rb
214
- - test/support/current_user/navigation_helper.rb
215
- - test/test_helper.rb
@@ -1 +0,0 @@
1
- 10750