mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 23:08:05 -05:00
Fix rails g devise:views -v mailer with the Simple Form generator.
Our Simple Form generator shouldn't be responsible for generating the `mailer` view directory, so we should skip it and let the Erb generator do the job. Closes #3254.
This commit is contained in:
@@ -83,6 +83,13 @@ module Devise
|
||||
source_root File.expand_path("../../templates/simple_form_for", __FILE__)
|
||||
desc "Copies simple form enabled views to your application."
|
||||
hide!
|
||||
|
||||
def copy_views
|
||||
if options[:views]
|
||||
options[:views].delete('mailer')
|
||||
end
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
class ErbGenerator < Rails::Generators::Base #:nodoc:
|
||||
|
||||
@@ -46,6 +46,13 @@ class ViewsGeneratorTest < Rails::Generators::TestCase
|
||||
assert_no_file "app/views/devise/mailer/confirmation_instructions.html.erb"
|
||||
end
|
||||
|
||||
test "Assert mailer specific directory with simple form" do
|
||||
run_generator %w(-v mailer -b simple_form_for)
|
||||
assert_file "app/views/devise/mailer/confirmation_instructions.html.erb"
|
||||
assert_file "app/views/devise/mailer/reset_password_instructions.html.erb"
|
||||
assert_file "app/views/devise/mailer/unlock_instructions.html.erb"
|
||||
end
|
||||
|
||||
test "Assert specified directories with scope" do
|
||||
run_generator %w(users -v sessions)
|
||||
assert_file "app/views/users/sessions/new.html.erb"
|
||||
|
||||
Reference in New Issue
Block a user