test/generators/bootstrap_generator_test.rb in ember-appkit-rails-0.3.2 vs test/generators/bootstrap_generator_test.rb in ember-appkit-rails-0.4.0
- old
+ new
@@ -5,11 +5,11 @@
include GeneratorTestSupport
tests Ember::Generators::BootstrapGenerator
destination File.join(Rails.root, "tmp", "generator_test_output")
- setup :prepare_destination, :copy_application
+ setup :prepare_destination, :copy_application, :copy_routes
test "Assert folder layout and .gitkeep files are properly created" do
run_generator []
assert_new_dirs
end
@@ -82,19 +82,27 @@
test "Does not error if Gemfile is missing" do
FileUtils.rm destination_root + '/Gemfile'
run_generator
end
+ test "Adds commented out greedy matcher to Rails routes file" do
+ run_generator
+
+ assert_file 'config/routes.rb' do |content|
+ assert_match(/^ # get '\*foo', :to => 'landing#index'$/, content)
+ end
+ end
+
private
def assert_files(app_path = app_path, config_path = config_path)
- assert_file "#{config_path}/environment.js"
- assert_file "#{config_path}/environments/development.js"
- assert_file "#{config_path}/environments/production.js"
- assert_file "#{config_path}/environments/test.js"
+ assert_file "#{config_path}/environment.js.erb"
+ assert_file "#{config_path}/environments/development.js.erb"
+ assert_file "#{config_path}/environments/production.js.erb"
+ assert_file "#{config_path}/environments/test.js.erb"
assert_file "#{config_path}/application.js"
assert_file "#{config_path}/router.js.es6"
- assert_file "#{config_path}/adapter.js.erb"
+ assert_file "#{config_path}/adapters/application.js.es6.erb"
assert_file "#{config_path}/initializers/csrf.js"
end
def confirm_turbolinks_removed(file)
assert_file file do |content|