mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fix test_helper for mountable plugin
This commit is contained in:
parent
5127857947
commit
a441293cd9
2 changed files with 7 additions and 0 deletions
|
@ -4,6 +4,9 @@ ENV["RAILS_ENV"] = "test"
|
|||
require File.expand_path("../../<%= options[:dummy_path] -%>/config/environment.rb", __FILE__)
|
||||
<% unless options[:skip_active_record] -%>
|
||||
ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../<%= options[:dummy_path] -%>/db/migrate", __FILE__)]
|
||||
<% if options[:mountable] -%>
|
||||
ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
require "rails/test_help"
|
||||
|
||||
|
|
|
@ -245,6 +245,10 @@ class PluginGeneratorTest < Rails::Generators::TestCase
|
|||
assert_match(/stylesheet_link_tag\s+['"]bukkits\/application['"]/, contents)
|
||||
assert_match(/javascript_include_tag\s+['"]bukkits\/application['"]/, contents)
|
||||
end
|
||||
assert_file "test/test_helper.rb" do |content|
|
||||
assert_match(/ActiveRecord::Migrator\.migrations_paths.+\.\.\/test\/dummy\/db\/migrate/, content)
|
||||
assert_match(/ActiveRecord::Migrator\.migrations_paths.+<<.+\.\.\/db\/migrate/, content)
|
||||
end
|
||||
end
|
||||
|
||||
def test_creating_gemspec
|
||||
|
|
Loading…
Reference in a new issue