clearance 1.6.0 → 1.6.1
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 +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +6 -8
- data/Gemfile +2 -2
- data/Gemfile.lock +20 -19
- data/NEWS.md +3 -0
- data/Rakefile +13 -14
- data/app/mailers/clearance_mailer.rb +9 -4
- data/app/views/clearance_mailer/change_password.html.erb +3 -3
- data/app/views/layouts/application.html.erb +1 -1
- data/app/views/passwords/edit.html.erb +2 -2
- data/app/views/passwords/new.html.erb +2 -2
- data/app/views/sessions/_form.html.erb +2 -2
- data/app/views/sessions/new.html.erb +1 -1
- data/app/views/users/_form.html.erb +1 -1
- data/app/views/users/new.html.erb +1 -1
- data/bin/setup +1 -2
- data/config/locales/clearance.en.yml +4 -4
- data/features/step_definitions/configuration_steps.rb +2 -2
- data/features/support/env.rb +15 -23
- data/gemfiles/rails3.2.gemfile +20 -0
- data/gemfiles/rails4.0.gemfile +20 -0
- data/gemfiles/rails4.1.gemfile +20 -0
- data/gemfiles/rails4.2.gemfile +20 -0
- data/lib/clearance/configuration.rb +1 -1
- data/lib/clearance/session.rb +5 -1
- data/lib/clearance/testing/deny_access_matcher.rb +1 -3
- data/lib/clearance/version.rb +1 -1
- data/lib/generators/clearance/install/install_generator.rb +5 -15
- data/spec/clearance/session_spec.rb +1 -1
- data/{lib/clearance/testing → spec/dummy}/app/controllers/application_controller.rb +0 -0
- data/spec/dummy/application.rb +47 -0
- data/{lib/clearance/testing → spec/dummy}/config/database.yml +0 -0
- data/{lib/clearance/testing → spec/dummy}/config/routes.rb +0 -0
- data/spec/generators/clearance/install/install_generator_spec.rb +118 -0
- data/spec/generators/clearance/routes/routes_generator_spec.rb +17 -0
- data/spec/generators/clearance/specs/specs_generator_spec.rb +26 -0
- data/spec/generators/clearance/views/views_generator_spec.rb +35 -0
- data/spec/mailers/clearance_mailer_spec.rb +48 -19
- data/spec/models/bcrypt_migration_from_sha1_spec.rb +81 -51
- data/spec/models/password_strategies_spec.rb +2 -0
- data/spec/spec_helper.rb +12 -18
- data/spec/support/app_templates/app/controllers/application_controller.rb +2 -0
- data/spec/support/app_templates/app/models/user.rb +5 -0
- data/spec/support/app_templates/config/routes.rb +3 -0
- data/spec/support/cookies.rb +1 -1
- data/spec/support/generator_spec_helpers.rb +40 -0
- metadata +31 -13
- data/.rspec +0 -2
- data/features/add_migrations_to_project.feature +0 -36
- data/features/copy_routes_to_host_application.feature +0 -9
- data/lib/clearance/testing/application.rb +0 -49
- data/lib/clearance/testing/assertion_error.rb +0 -6
@@ -1,9 +0,0 @@
|
|
1
|
-
Feature: copy routes to host application
|
2
|
-
|
3
|
-
Background:
|
4
|
-
Given I have a project with clearance
|
5
|
-
|
6
|
-
Scenario:
|
7
|
-
When I successfully run `bundle exec rails generate clearance:install`
|
8
|
-
And I successfully run `bundle exec rails generate clearance:routes`
|
9
|
-
Then the file "config/routes.rb" should contain "get '/sign_in' => 'clearance/sessions#new', as: 'sign_in'"
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'rails/all'
|
2
|
-
|
3
|
-
module Clearance
|
4
|
-
module Testing
|
5
|
-
APP_ROOT = File.expand_path('..', __FILE__).freeze
|
6
|
-
|
7
|
-
def self.rails4?
|
8
|
-
Rails::VERSION::MAJOR >= 4
|
9
|
-
end
|
10
|
-
|
11
|
-
I18n.enforce_available_locales = true
|
12
|
-
|
13
|
-
class Application < Rails::Application
|
14
|
-
config.action_controller.allow_forgery_protection = false
|
15
|
-
config.action_controller.perform_caching = false
|
16
|
-
config.action_dispatch.show_exceptions = false
|
17
|
-
config.action_mailer.default_url_options = { host: 'localhost' }
|
18
|
-
config.action_mailer.delivery_method = :test
|
19
|
-
config.active_support.deprecation = :stderr
|
20
|
-
config.assets.enabled = true
|
21
|
-
config.cache_classes = true
|
22
|
-
config.consider_all_requests_local = true
|
23
|
-
config.eager_load = false
|
24
|
-
config.encoding = 'utf-8'
|
25
|
-
config.paths['app/controllers'] << "#{APP_ROOT}/app/controllers"
|
26
|
-
config.paths['app/views'] << "#{APP_ROOT}/app/views"
|
27
|
-
config.paths['config/database'] = "#{APP_ROOT}/config/database.yml"
|
28
|
-
config.paths['log'] = 'tmp/log/development.log'
|
29
|
-
config.secret_token = 'SECRET_TOKEN_IS_MIN_30_CHARS_LONG'
|
30
|
-
config.active_support.test_order = :random
|
31
|
-
|
32
|
-
if Clearance::Testing.rails4?
|
33
|
-
config.paths.add 'config/routes.rb', with: "#{APP_ROOT}/config/routes.rb"
|
34
|
-
config.secret_key_base = 'SECRET_KEY_BASE'
|
35
|
-
else
|
36
|
-
config.paths.add 'config/routes', with: "#{APP_ROOT}/config/routes.rb"
|
37
|
-
end
|
38
|
-
|
39
|
-
def require_environment!
|
40
|
-
initialize!
|
41
|
-
end
|
42
|
-
|
43
|
-
def initialize!(&block)
|
44
|
-
FileUtils.mkdir_p(Rails.root.join('db').to_s)
|
45
|
-
super unless @initialized
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|