test/generators/component_generator_test.rb in ember-appkit-rails-0.1.2 vs test/generators/component_generator_test.rb in ember-appkit-rails-0.2.0
- old
+ new
@@ -9,48 +9,41 @@
setup :prepare_destination
test "default_component" do
run_generator ["PostChart"]
- assert_file "app/assets/javascripts/components/post-chart_component.js.es6"
- assert_file "app/assets/javascripts/templates/components/post-chart.hbs"
+ assert_file "#{app_path}/components/post-chart_component.js.es6"
+ assert_file "#{app_path}/templates/components/post-chart.hbs"
end
test "Assert files are properly created (CamelCase)" do
run_generator %w(PostChart)
- assert_file "#{ember_path}/components/post-chart_component.js.es6"
- assert_file "#{ember_path}/templates/components/post-chart.hbs"
+ assert_file "#{app_path}/components/post-chart_component.js.es6"
+ assert_file "#{app_path}/templates/components/post-chart.hbs"
end
test "Assert object names are properly created with CamelCase name" do
run_generator %w(PostChart)
- assert_file "#{ember_path}/components/post-chart_component.js.es6"
- assert_file "#{ember_path}/templates/components/post-chart.hbs"
+ assert_file "#{app_path}/components/post-chart_component.js.es6"
+ assert_file "#{app_path}/templates/components/post-chart.hbs"
end
test "Assert files are properly created (lower-case)" do
run_generator %w(post-chart)
- assert_file "#{ember_path}/components/post-chart_component.js.es6"
- assert_file "#{ember_path}/templates/components/post-chart.hbs"
+ assert_file "#{app_path}/components/post-chart_component.js.es6"
+ assert_file "#{app_path}/templates/components/post-chart.hbs"
end
test "Assert object names are properly created with lower-case name" do
run_generator %w(post-chart)
- assert_file "#{ember_path}/components/post-chart_component.js.es6"
- assert_file "#{ember_path}/templates/components/post-chart.hbs"
+ assert_file "#{app_path}/components/post-chart_component.js.es6"
+ assert_file "#{app_path}/templates/components/post-chart.hbs"
end
- test "Assert files are properly created with custom path" do
- custom_path = ember_path("custom")
- run_generator [ "PostChart", "-d", custom_path ]
- assert_file "#{custom_path}/components/post-chart_component.js.es6"
- assert_file "#{custom_path}/templates/components/post-chart.hbs"
- end
+ test "Uses config.ember.appkit.paths.app" do
+ custom_path = app_path("custom")
- test "Uses config.ember.ember_path" do
- custom_path = ember_path("custom")
-
- with_config ember_path: custom_path do
+ with_config paths: {app: custom_path} do
run_generator ["PostChart"]
assert_file "#{custom_path}/components/post-chart_component.js.es6"
assert_file "#{custom_path}/templates/components/post-chart.hbs"
end
end