clearance 1.10.1 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of clearance might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +20 -8
- data/.yardopts +3 -0
- data/Appraisals +13 -16
- data/Gemfile +7 -5
- data/Gemfile.lock +124 -130
- data/NEWS.md +171 -2
- data/README.md +99 -42
- data/app/controllers/clearance/passwords_controller.rb +35 -21
- data/app/controllers/clearance/sessions_controller.rb +17 -3
- data/app/controllers/clearance/users_controller.rb +10 -4
- data/app/mailers/clearance_mailer.rb +2 -3
- data/app/views/clearance_mailer/change_password.text.erb +1 -1
- data/app/views/layouts/application.html.erb +0 -1
- data/bin/setup +6 -2
- data/clearance.gemspec +5 -2
- data/config/locales/clearance.en.yml +9 -0
- data/gemfiles/rails_4.2.gemfile +20 -0
- data/gemfiles/rails_5.0.gemfile +21 -0
- data/gemfiles/rails_5.1.gemfile +21 -0
- data/gemfiles/rails_5.2.gemfile +21 -0
- data/lib/clearance/authentication.rb +63 -3
- data/lib/clearance/authorization.rb +48 -5
- data/lib/clearance/back_door.rb +55 -6
- data/lib/clearance/configuration.rb +50 -10
- data/lib/clearance/constraints/signed_in.rb +21 -0
- data/lib/clearance/constraints/signed_out.rb +12 -0
- data/lib/clearance/constraints.rb +12 -0
- data/lib/clearance/controller.rb +13 -0
- data/lib/clearance/default_sign_in_guard.rb +17 -0
- data/lib/clearance/engine.rb +18 -5
- data/lib/clearance/password_strategies/bcrypt.rb +16 -21
- data/lib/clearance/password_strategies/bcrypt_migration_from_sha1.rb +10 -0
- data/lib/clearance/password_strategies/blowfish.rb +10 -1
- data/lib/clearance/password_strategies/sha1.rb +9 -0
- data/lib/clearance/password_strategies.rb +13 -0
- data/lib/clearance/rack_session.rb +13 -0
- data/lib/clearance/rspec.rb +15 -4
- data/lib/clearance/session.rb +62 -13
- data/lib/clearance/session_status.rb +7 -0
- data/lib/clearance/sign_in_guard.rb +65 -0
- data/lib/clearance/test_unit.rb +3 -3
- data/lib/clearance/testing/controller_helpers.rb +57 -0
- data/lib/clearance/testing/deny_access_matcher.rb +36 -2
- data/lib/clearance/testing/helpers.rb +9 -25
- data/lib/clearance/testing/view_helpers.rb +32 -0
- data/lib/clearance/token.rb +7 -0
- data/lib/clearance/user.rb +183 -4
- data/lib/clearance/version.rb +1 -1
- data/lib/generators/clearance/install/install_generator.rb +28 -9
- data/lib/generators/clearance/install/templates/README +1 -1
- data/lib/generators/clearance/install/templates/clearance.rb +1 -0
- data/lib/generators/clearance/install/templates/db/migrate/{add_clearance_to_users.rb → add_clearance_to_users.rb.erb} +3 -3
- data/lib/generators/clearance/install/templates/db/migrate/{create_users.rb → create_users.rb.erb} +2 -2
- data/lib/generators/clearance/install/templates/user.rb.erb +3 -0
- data/lib/generators/clearance/routes/routes_generator.rb +23 -0
- data/lib/generators/clearance/routes/templates/routes.rb +7 -7
- data/lib/generators/clearance/specs/templates/factories/clearance.rb +2 -2
- data/lib/generators/clearance/specs/templates/features/clearance/user_signs_out_spec.rb.tt +1 -1
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_resets_password_spec.rb.tt +12 -3
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_signs_in_spec.rb.tt +3 -3
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_signs_up_spec.rb.tt +1 -1
- data/lib/generators/clearance/specs/templates/features/clearance/visitor_updates_password_spec.rb.tt +2 -2
- data/lib/generators/clearance/specs/templates/support/features/clearance_helpers.rb +2 -2
- data/spec/acceptance/clearance_installation_spec.rb +15 -7
- data/spec/app_templates/app/models/rails5/user.rb +5 -0
- data/spec/app_templates/config/initializers/clearance.rb +2 -0
- data/spec/app_templates/testapp/Gemfile +1 -1
- data/spec/app_templates/testapp/app/controllers/home_controller.rb +5 -1
- data/spec/clearance/back_door_spec.rb +70 -6
- data/spec/clearance/session_spec.rb +4 -16
- data/spec/clearance/testing/controller_helpers_spec.rb +38 -0
- data/spec/clearance/testing/view_helpers_spec.rb +37 -0
- data/spec/configuration_spec.rb +79 -86
- data/spec/controllers/apis_controller_spec.rb +6 -2
- data/spec/controllers/forgeries_controller_spec.rb +12 -3
- data/spec/controllers/passwords_controller_spec.rb +74 -38
- data/spec/controllers/permissions_controller_spec.rb +13 -3
- data/spec/controllers/sessions_controller_spec.rb +40 -11
- data/spec/controllers/users_controller_spec.rb +16 -8
- data/spec/dummy/app/controllers/application_controller.rb +5 -1
- data/spec/dummy/application.rb +9 -11
- data/spec/factories.rb +5 -5
- data/spec/generators/clearance/install/install_generator_spec.rb +29 -3
- data/spec/generators/clearance/routes/routes_generator_spec.rb +5 -1
- data/spec/helpers/helper_helpers_spec.rb +10 -0
- data/spec/{user_spec.rb → models/user_spec.rb} +10 -1
- data/spec/password_strategies/blowfish_spec.rb +1 -1
- data/spec/requests/cookie_options_spec.rb +52 -0
- data/spec/requests/csrf_rotation_spec.rb +35 -0
- data/spec/requests/password_maintenance_spec.rb +18 -0
- data/spec/requests/token_expiration_spec.rb +54 -0
- data/spec/spec_helper.rb +22 -4
- data/spec/support/environment.rb +12 -0
- data/spec/support/generator_spec_helpers.rb +13 -1
- data/spec/support/http_method_shim.rb +25 -0
- data/spec/support/request_with_remember_token.rb +5 -0
- data/spec/views/view_helpers_spec.rb +10 -0
- metadata +69 -15
- data/gemfiles/rails3.2.gemfile +0 -18
- data/gemfiles/rails4.0.gemfile +0 -19
- data/gemfiles/rails4.1.gemfile +0 -18
- data/gemfiles/rails4.2.gemfile +0 -18
- data/lib/generators/clearance/install/templates/user.rb +0 -3
- data/spec/clearance/testing/helpers_spec.rb +0 -38
@@ -0,0 +1,18 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Password maintenance" do
|
4
|
+
context "when updating the password" do
|
5
|
+
it "signs the user in and redirects" do
|
6
|
+
user = create(:user, :with_forgotten_password)
|
7
|
+
|
8
|
+
put user_password_url(user), params: {
|
9
|
+
user_id: user,
|
10
|
+
token: user.confirmation_token,
|
11
|
+
password_reset: { password: "my_new_password" },
|
12
|
+
}
|
13
|
+
|
14
|
+
expect(response).to redirect_to(Clearance.configuration.redirect_url)
|
15
|
+
expect(cookies["remember_token"]).to be_present
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Token expiration" do
|
4
|
+
describe "after signing in" do
|
5
|
+
before do
|
6
|
+
create_user_and_sign_in
|
7
|
+
@initial_cookies = remember_token_cookies
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should have a remember_token cookie with a future expiration" do
|
11
|
+
expect(first_cookie.expires).to be_between(
|
12
|
+
1.years.from_now - 1.second,
|
13
|
+
1.years.from_now,
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "after signing in and making a followup request" do
|
19
|
+
before do
|
20
|
+
create_user_and_sign_in
|
21
|
+
@initial_cookies = remember_token_cookies
|
22
|
+
|
23
|
+
Timecop.travel(1.minute.from_now) do
|
24
|
+
get root_path
|
25
|
+
@followup_cookies = remember_token_cookies
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should set a remember_token on each request with updated expiration" do
|
30
|
+
expect(@followup_cookies.length).to be >= 1,
|
31
|
+
"remember token wasn't set on second request"
|
32
|
+
|
33
|
+
expect(second_cookie.expires).to be > first_cookie.expires
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def first_cookie
|
38
|
+
Rack::Test::Cookie.new @initial_cookies.last
|
39
|
+
end
|
40
|
+
|
41
|
+
def second_cookie
|
42
|
+
Rack::Test::Cookie.new @followup_cookies.last
|
43
|
+
end
|
44
|
+
|
45
|
+
def create_user_and_sign_in
|
46
|
+
user = create(:user, password: "password")
|
47
|
+
|
48
|
+
get sign_in_path
|
49
|
+
|
50
|
+
post session_path, params: {
|
51
|
+
session: { email: user.email, password: "password" },
|
52
|
+
}
|
53
|
+
end
|
54
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,7 +4,7 @@ require "rails/all"
|
|
4
4
|
require "dummy/application"
|
5
5
|
|
6
6
|
require "clearance/rspec"
|
7
|
-
require "
|
7
|
+
require "factory_bot_rails"
|
8
8
|
require "rspec/rails"
|
9
9
|
require "shoulda-matchers"
|
10
10
|
require "timecop"
|
@@ -14,7 +14,7 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
|
14
14
|
Dummy::Application.initialize!
|
15
15
|
|
16
16
|
RSpec.configure do |config|
|
17
|
-
config.include
|
17
|
+
config.include FactoryBot::Syntax::Methods
|
18
18
|
config.infer_spec_type_from_file_location!
|
19
19
|
config.order = :random
|
20
20
|
config.use_transactional_fixtures = true
|
@@ -26,9 +26,27 @@ RSpec.configure do |config|
|
|
26
26
|
config.mock_with :rspec do |mocks|
|
27
27
|
mocks.syntax = :expect
|
28
28
|
end
|
29
|
+
|
30
|
+
config.before { restore_default_warning_free_config }
|
31
|
+
|
32
|
+
if Rails::VERSION::MAJOR >= 5
|
33
|
+
require 'rails-controller-testing'
|
34
|
+
config.include Rails::Controller::Testing::TestProcess
|
35
|
+
config.include Rails::Controller::Testing::TemplateAssertions
|
36
|
+
config.include Rails::Controller::Testing::Integration
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Shoulda::Matchers.configure do |config|
|
41
|
+
config.integrate do |with|
|
42
|
+
with.test_framework :rspec
|
43
|
+
with.library :action_controller
|
44
|
+
with.library :active_model
|
45
|
+
with.library :active_record
|
46
|
+
end
|
29
47
|
end
|
30
48
|
|
31
|
-
def
|
49
|
+
def restore_default_warning_free_config
|
32
50
|
Clearance.configuration = nil
|
33
|
-
Clearance.configure {}
|
51
|
+
Clearance.configure { |config| config.rotate_csrf_on_sign_in = true }
|
34
52
|
end
|
@@ -9,12 +9,16 @@ module GeneratorSpecHelpers
|
|
9
9
|
copy_to_generator_root("config", "routes.rb")
|
10
10
|
end
|
11
11
|
|
12
|
+
def provide_existing_initializer
|
13
|
+
copy_to_generator_root("config/initializers", "clearance.rb")
|
14
|
+
end
|
15
|
+
|
12
16
|
def provide_existing_application_controller
|
13
17
|
copy_to_generator_root("app/controllers", "application_controller.rb")
|
14
18
|
end
|
15
19
|
|
16
20
|
def provide_existing_user_class
|
17
|
-
copy_to_generator_root("app/models", "user.rb")
|
21
|
+
copy_to_generator_root("app/models", versionize_template("user.rb"))
|
18
22
|
allow(File).to receive(:exist?).and_call_original
|
19
23
|
allow(File).to receive(:exist?).with("app/models/user.rb").and_return(true)
|
20
24
|
end
|
@@ -28,6 +32,14 @@ module GeneratorSpecHelpers
|
|
28
32
|
FileUtils.mkdir_p(destination)
|
29
33
|
FileUtils.cp(template_file, destination)
|
30
34
|
end
|
35
|
+
|
36
|
+
def versionize_template(template_file)
|
37
|
+
if Rails.version >= "5.0.0"
|
38
|
+
template_file = ["rails5", template_file].join("/")
|
39
|
+
end
|
40
|
+
|
41
|
+
template_file
|
42
|
+
end
|
31
43
|
end
|
32
44
|
|
33
45
|
RSpec.configure do |config|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Rails 5 deprecates calling HTTP action methods with positional arguments
|
2
|
+
# in favor of keyword arguments. However, the keyword argument form is only
|
3
|
+
# supported in Rails 5+. Since we support 4.2, we must give it a shim to massage
|
4
|
+
# the params into the previous style!
|
5
|
+
|
6
|
+
module PreRailsFiveHTTPMethodShim
|
7
|
+
def get(path, params: {}, headers: {}, format: :html)
|
8
|
+
super(path, params.merge(format: format), headers)
|
9
|
+
end
|
10
|
+
|
11
|
+
def put(path, params: {}, headers: {}, format: :html)
|
12
|
+
super(path, params.merge(format: format), headers)
|
13
|
+
end
|
14
|
+
|
15
|
+
def post(path, params: {}, headers: {}, format: :html)
|
16
|
+
super(path, params.merge(format: format), headers)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if Rails::VERSION::MAJOR < 5
|
21
|
+
RSpec.configure do |config|
|
22
|
+
config.include PreRailsFiveHTTPMethodShim, type: :controller
|
23
|
+
config.include PreRailsFiveHTTPMethodShim, type: :request
|
24
|
+
end
|
25
|
+
end
|
@@ -12,6 +12,11 @@ module RememberTokenHelpers
|
|
12
12
|
def request_without_remember_token
|
13
13
|
request_with_remember_token nil
|
14
14
|
end
|
15
|
+
|
16
|
+
def remember_token_cookies
|
17
|
+
cookie_lines = headers["Set-Cookie"].lines.map(&:chomp)
|
18
|
+
cookie_lines.select { |name| name =~ /^remember_token/ }
|
19
|
+
end
|
15
20
|
end
|
16
21
|
|
17
22
|
RSpec.configure do |config|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Croak
|
@@ -25,7 +25,7 @@ authors:
|
|
25
25
|
autorequire:
|
26
26
|
bindir: bin
|
27
27
|
cert_chain: []
|
28
|
-
date:
|
28
|
+
date: 2019-04-11 00:00:00.000000000 Z
|
29
29
|
dependencies:
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bcrypt
|
@@ -56,7 +56,49 @@ dependencies:
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '1.4'
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
|
-
name:
|
59
|
+
name: railties
|
60
|
+
requirement: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '3.1'
|
65
|
+
type: :runtime
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '3.1'
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: activemodel
|
74
|
+
requirement: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '3.1'
|
79
|
+
type: :runtime
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '3.1'
|
86
|
+
- !ruby/object:Gem::Dependency
|
87
|
+
name: activerecord
|
88
|
+
requirement: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '3.1'
|
93
|
+
type: :runtime
|
94
|
+
prerelease: false
|
95
|
+
version_requirements: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '3.1'
|
100
|
+
- !ruby/object:Gem::Dependency
|
101
|
+
name: actionmailer
|
60
102
|
requirement: !ruby/object:Gem::Requirement
|
61
103
|
requirements:
|
62
104
|
- - ">="
|
@@ -112,10 +154,10 @@ files:
|
|
112
154
|
- config/routes.rb
|
113
155
|
- db/migrate/20110111224543_create_clearance_users.rb
|
114
156
|
- db/schema.rb
|
115
|
-
- gemfiles/
|
116
|
-
- gemfiles/
|
117
|
-
- gemfiles/
|
118
|
-
- gemfiles/
|
157
|
+
- gemfiles/rails_4.2.gemfile
|
158
|
+
- gemfiles/rails_5.0.gemfile
|
159
|
+
- gemfiles/rails_5.1.gemfile
|
160
|
+
- gemfiles/rails_5.2.gemfile
|
119
161
|
- lib/clearance.rb
|
120
162
|
- lib/clearance/authentication.rb
|
121
163
|
- lib/clearance/authorization.rb
|
@@ -139,17 +181,19 @@ files:
|
|
139
181
|
- lib/clearance/sign_in_guard.rb
|
140
182
|
- lib/clearance/test_unit.rb
|
141
183
|
- lib/clearance/testing.rb
|
184
|
+
- lib/clearance/testing/controller_helpers.rb
|
142
185
|
- lib/clearance/testing/deny_access_matcher.rb
|
143
186
|
- lib/clearance/testing/helpers.rb
|
187
|
+
- lib/clearance/testing/view_helpers.rb
|
144
188
|
- lib/clearance/token.rb
|
145
189
|
- lib/clearance/user.rb
|
146
190
|
- lib/clearance/version.rb
|
147
191
|
- lib/generators/clearance/install/install_generator.rb
|
148
192
|
- lib/generators/clearance/install/templates/README
|
149
193
|
- lib/generators/clearance/install/templates/clearance.rb
|
150
|
-
- lib/generators/clearance/install/templates/db/migrate/add_clearance_to_users.rb
|
151
|
-
- lib/generators/clearance/install/templates/db/migrate/create_users.rb
|
152
|
-
- lib/generators/clearance/install/templates/user.rb
|
194
|
+
- lib/generators/clearance/install/templates/db/migrate/add_clearance_to_users.rb.erb
|
195
|
+
- lib/generators/clearance/install/templates/db/migrate/create_users.rb.erb
|
196
|
+
- lib/generators/clearance/install/templates/user.rb.erb
|
153
197
|
- lib/generators/clearance/routes/routes_generator.rb
|
154
198
|
- lib/generators/clearance/routes/templates/routes.rb
|
155
199
|
- lib/generators/clearance/specs/USAGE
|
@@ -166,7 +210,9 @@ files:
|
|
166
210
|
- lib/generators/clearance/views/views_generator.rb
|
167
211
|
- spec/acceptance/clearance_installation_spec.rb
|
168
212
|
- spec/app_templates/app/controllers/application_controller.rb
|
213
|
+
- spec/app_templates/app/models/rails5/user.rb
|
169
214
|
- spec/app_templates/app/models/user.rb
|
215
|
+
- spec/app_templates/config/initializers/clearance.rb
|
170
216
|
- spec/app_templates/config/routes.rb
|
171
217
|
- spec/app_templates/testapp/Gemfile
|
172
218
|
- spec/app_templates/testapp/app/controllers/home_controller.rb
|
@@ -180,7 +226,8 @@ files:
|
|
180
226
|
- spec/clearance/rack_session_spec.rb
|
181
227
|
- spec/clearance/session_spec.rb
|
182
228
|
- spec/clearance/sign_in_guard_spec.rb
|
183
|
-
- spec/clearance/testing/
|
229
|
+
- spec/clearance/testing/controller_helpers_spec.rb
|
230
|
+
- spec/clearance/testing/view_helpers_spec.rb
|
184
231
|
- spec/clearance/token_spec.rb
|
185
232
|
- spec/configuration_spec.rb
|
186
233
|
- spec/controllers/apis_controller_spec.rb
|
@@ -200,22 +247,30 @@ files:
|
|
200
247
|
- spec/generators/clearance/routes/routes_generator_spec.rb
|
201
248
|
- spec/generators/clearance/specs/specs_generator_spec.rb
|
202
249
|
- spec/generators/clearance/views/views_generator_spec.rb
|
250
|
+
- spec/helpers/helper_helpers_spec.rb
|
203
251
|
- spec/mailers/clearance_mailer_spec.rb
|
252
|
+
- spec/models/user_spec.rb
|
204
253
|
- spec/password_strategies/bcrypt_migration_from_sha1_spec.rb
|
205
254
|
- spec/password_strategies/bcrypt_spec.rb
|
206
255
|
- spec/password_strategies/blowfish_spec.rb
|
207
256
|
- spec/password_strategies/password_strategies_spec.rb
|
208
257
|
- spec/password_strategies/sha1_spec.rb
|
258
|
+
- spec/requests/cookie_options_spec.rb
|
259
|
+
- spec/requests/csrf_rotation_spec.rb
|
260
|
+
- spec/requests/password_maintenance_spec.rb
|
261
|
+
- spec/requests/token_expiration_spec.rb
|
209
262
|
- spec/routing/clearance_routes_spec.rb
|
210
263
|
- spec/spec_helper.rb
|
211
264
|
- spec/support/clearance.rb
|
212
265
|
- spec/support/cookies.rb
|
266
|
+
- spec/support/environment.rb
|
213
267
|
- spec/support/fake_model_with_password_strategy.rb
|
214
268
|
- spec/support/fake_model_without_password_strategy.rb
|
215
269
|
- spec/support/generator_spec_helpers.rb
|
270
|
+
- spec/support/http_method_shim.rb
|
216
271
|
- spec/support/request_with_remember_token.rb
|
217
|
-
- spec/
|
218
|
-
homepage:
|
272
|
+
- spec/views/view_helpers_spec.rb
|
273
|
+
homepage: https://github.com/thoughtbot/clearance
|
219
274
|
licenses:
|
220
275
|
- MIT
|
221
276
|
metadata: {}
|
@@ -235,8 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
290
|
- !ruby/object:Gem::Version
|
236
291
|
version: '0'
|
237
292
|
requirements: []
|
238
|
-
|
239
|
-
rubygems_version: 2.4.5
|
293
|
+
rubygems_version: 3.0.3
|
240
294
|
signing_key:
|
241
295
|
specification_version: 4
|
242
296
|
summary: Rails authentication & authorization with email & password.
|
data/gemfiles/rails3.2.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal", "~> 1.0"
|
6
|
-
gem "ammeter"
|
7
|
-
gem "bundler", "~> 1.3"
|
8
|
-
gem "capybara", ">= 2.3"
|
9
|
-
gem "database_cleaner", "~> 1.0"
|
10
|
-
gem "factory_girl_rails", "~> 4.2"
|
11
|
-
gem "rspec-rails", "~> 3.1"
|
12
|
-
gem "shoulda-matchers", "~> 2.8"
|
13
|
-
gem "sqlite3", "~> 1.3"
|
14
|
-
gem "timecop", "~> 0.6"
|
15
|
-
gem "pry", :require => false
|
16
|
-
gem "rails", "~> 3.2.21"
|
17
|
-
|
18
|
-
gemspec :path => "../"
|
data/gemfiles/rails4.0.gemfile
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal", "~> 1.0"
|
6
|
-
gem "ammeter"
|
7
|
-
gem "bundler", "~> 1.3"
|
8
|
-
gem "capybara", ">= 2.3"
|
9
|
-
gem "database_cleaner", "~> 1.0"
|
10
|
-
gem "factory_girl_rails", "~> 4.2"
|
11
|
-
gem "rspec-rails", "~> 3.1"
|
12
|
-
gem "shoulda-matchers", "~> 2.8"
|
13
|
-
gem "sqlite3", "~> 1.3"
|
14
|
-
gem "timecop", "~> 0.6"
|
15
|
-
gem "pry", :require => false
|
16
|
-
gem "rails", "~> 4.0.13"
|
17
|
-
gem "test-unit"
|
18
|
-
|
19
|
-
gemspec :path => "../"
|
data/gemfiles/rails4.1.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal", "~> 1.0"
|
6
|
-
gem "ammeter"
|
7
|
-
gem "bundler", "~> 1.3"
|
8
|
-
gem "capybara", ">= 2.3"
|
9
|
-
gem "database_cleaner", "~> 1.0"
|
10
|
-
gem "factory_girl_rails", "~> 4.2"
|
11
|
-
gem "rspec-rails", "~> 3.1"
|
12
|
-
gem "shoulda-matchers", "~> 2.8"
|
13
|
-
gem "sqlite3", "~> 1.3"
|
14
|
-
gem "timecop", "~> 0.6"
|
15
|
-
gem "pry", :require => false
|
16
|
-
gem "rails", "~> 4.1.9"
|
17
|
-
|
18
|
-
gemspec :path => "../"
|
data/gemfiles/rails4.2.gemfile
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal", "~> 1.0"
|
6
|
-
gem "ammeter"
|
7
|
-
gem "bundler", "~> 1.3"
|
8
|
-
gem "capybara", ">= 2.3"
|
9
|
-
gem "database_cleaner", "~> 1.0"
|
10
|
-
gem "factory_girl_rails", "~> 4.2"
|
11
|
-
gem "rspec-rails", "~> 3.1"
|
12
|
-
gem "shoulda-matchers", "~> 2.8"
|
13
|
-
gem "sqlite3", "~> 1.3"
|
14
|
-
gem "timecop", "~> 0.6"
|
15
|
-
gem "pry", :require => false
|
16
|
-
gem "rails", "~> 4.2.0"
|
17
|
-
|
18
|
-
gemspec :path => "../"
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Clearance::Testing::Helpers do
|
4
|
-
class TestClass
|
5
|
-
include Clearance::Testing::Helpers
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
@controller = Controller.new
|
9
|
-
end
|
10
|
-
|
11
|
-
class Controller
|
12
|
-
def sign_in(user); end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '#sign_in' do
|
17
|
-
it 'creates an instance of the clearance user model with FactoryGirl' do
|
18
|
-
MyUserModel = Class.new
|
19
|
-
allow(FactoryGirl).to receive(:create)
|
20
|
-
allow(Clearance.configuration).to receive(:user_model).
|
21
|
-
and_return(MyUserModel)
|
22
|
-
|
23
|
-
TestClass.new.sign_in
|
24
|
-
|
25
|
-
expect(FactoryGirl).to have_received(:create).with(:my_user_model)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe '#sign_in_as' do
|
30
|
-
it 'returns the user if signed in successfully' do
|
31
|
-
user = build(:user)
|
32
|
-
|
33
|
-
returned_user = TestClass.new.sign_in_as user
|
34
|
-
|
35
|
-
expect(returned_user).to eq user
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|