test/generators/bootstrap_generator_test.rb in ember-appkit-rails-0.4.0 vs test/generators/bootstrap_generator_test.rb in ember-appkit-rails-0.5.0
- old
+ new
@@ -23,19 +23,19 @@
test "create bootstrap with and custom app path" do
custom_path = app_path("custom")
run_generator ["-a", custom_path]
assert_files custom_path, config_path
- assert_file 'config/application.rb', /config\.ember\.appkit\.paths\.app = '#{custom_path}'/
+ assert_file 'config/application.rb', /config\.ember\.paths\.app = '#{custom_path}'/
end
test "create bootstrap with and custom config path" do
custom_path = config_path("custom")
run_generator ["-c", custom_path]
assert_files app_path, custom_path
- assert_file 'config/application.rb', /config\.ember\.appkit\.paths\.config = '#{custom_path}'/
+ assert_file 'config/application.rb', /config\.ember\.paths\.config = '#{custom_path}'/
end
test "create bootstrap with custom app name" do
run_generator ["-n", "MyApp"]
@@ -93,17 +93,25 @@
end
private
def assert_files(app_path = app_path, config_path = config_path)
+ %W{models controllers views routes components templates templates/components mixins}.each do |dir|
+ assert_directory "#{app_path}/#{dir}"
+ end
+ assert_directory "#{config_path}/serializers"
+
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}/adapters/application.js.es6.erb"
+ assert_file "#{config_path}/router.es6"
+ assert_file "#{config_path}/adapters/application.es6.erb"
assert_file "#{config_path}/initializers/csrf.js"
+ assert_file "config/initializers/teaspoon.rb"
+ assert_file "test/teaspoon_env.rb"
+ assert_file "test/test_helper.js"
end
def confirm_turbolinks_removed(file)
assert_file file do |content|
assert_no_match(/turbolinks/, content)