Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/generators/templates/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"

# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'
Expand All @@ -36,7 +36,7 @@
# Load and configure the ORM. Supports :active_record (default) and
# :mongoid (bson_ext recommended) by default. Other ORMs may be
# available as additional gems.
require 'devise/orm/<%= options[:orm] %>'
require "devise/orm/<%= options[:orm] %>"

# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
Expand All @@ -58,12 +58,12 @@
# Configure which authentication keys should be case-insensitive.
# These keys will be downcased upon creating or modifying a user and when used
# to authenticate or find a user. Default is :email.
config.case_insensitive_keys = [:email]
config.case_insensitive_keys = [ :email ]

# Configure which authentication keys should have whitespace stripped.
# These keys will have whitespace before and after removed upon creating or
# modifying a user and when used to authenticate or find a user. Default is :email.
config.strip_whitespace_keys = [:email]
config.strip_whitespace_keys = [ :email ]

# Tell if authentication through request.params is enabled. True by default.
# It can be set to an array that will enable params authentication only for the
Expand Down Expand Up @@ -97,7 +97,7 @@
# Notice that if you are skipping storage for all authentication paths, you
# may want to disable generating routes to Devise's sessions controller by
# passing skip: :sessions to `devise_for` in your config/routes.rb
config.skip_session_storage = [:http_auth]
config.skip_session_storage = [ :http_auth ]

# By default, Devise cleans up the CSRF token on authentication to
# avoid CSRF token fixation attacks. This means that, when using AJAX
Expand Down
5 changes: 5 additions & 0 deletions test/generators/install_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ class InstallGeneratorTest < Rails::Generators::TestCase
test "assert all files are properly created" do
run_generator(["--orm=active_record"])
assert_file "config/initializers/devise.rb", /devise\/orm\/active_record/
assert_file "config/initializers/devise.rb", /config\.mailer_sender = "please-change-me-at-config-initializers-devise@example\.com"/
assert_file "config/initializers/devise.rb", /require "devise\/orm\/active_record"/
assert_file "config/initializers/devise.rb", /config\.case_insensitive_keys = \[ :email \]/
assert_file "config/initializers/devise.rb", /config\.strip_whitespace_keys = \[ :email \]/
assert_file "config/initializers/devise.rb", /config\.skip_session_storage = \[ :http_auth \]/
assert_file "config/locales/devise.en.yml"
end

Expand Down