提交 9725bff2 编写于 作者: A Arun Agrawal

Cleaned up app generator test

上级 5542dff8
......@@ -29,6 +29,7 @@
lib/tasks
lib/assets
log
test/test_helper.rb
test/fixtures
test/controllers
test/models
......@@ -37,6 +38,8 @@
test/integration
vendor
vendor/assets
vendor/assets/stylesheets
vendor/assets/javascripts
tmp/cache
tmp/cache/assets
)
......@@ -58,6 +61,7 @@ def test_assets
assert_file("app/views/layouts/application.html.erb", /stylesheet_link_tag\s+"application", media: "all", "data-turbolinks-track" => true/)
assert_file("app/views/layouts/application.html.erb", /javascript_include_tag\s+"application", "data-turbolinks-track" => true/)
assert_file("app/assets/stylesheets/application.css")
assert_file("app/assets/javascripts/application.js")
end
def test_invalid_application_name_raises_an_error
......@@ -318,33 +322,13 @@ def test_inclusion_of_plateform_dependent_gems
end
end
def test_creation_of_a_test_directory
run_generator
assert_file 'test'
end
def test_creation_of_app_assets_images_directory
run_generator
assert_file "app/assets/images"
end
def test_creation_of_vendor_assets_javascripts_directory
run_generator
assert_file "vendor/assets/javascripts"
end
def test_creation_of_vendor_assets_stylesheets_directory
run_generator
assert_file "vendor/assets/stylesheets"
end
def test_jquery_is_the_default_javascript_library
run_generator
assert_file "app/assets/javascripts/application.js" do |contents|
assert_match %r{^//= require jquery}, contents
assert_match %r{^//= require jquery_ujs}, contents
end
assert_file "Gemfile", /^gem 'jquery-rails'/
assert_gem "jquery-rails"
end
def test_other_javascript_libraries
......@@ -369,6 +353,7 @@ def test_javascript_is_skipped_if_required
assert_file "Gemfile" do |content|
assert_no_match(/coffee-rails/, content)
assert_no_match(/jquery-rails/, content)
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册