Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #13010 from arunagw/cleanedup-generator-test

Cleaned up app generator test
  • Loading branch information...
commit 845b944b907a182f0bc1f4a25e849c3df5218b94 2 parents 5542dff + 9725bff
@senny senny authored
Showing with 6 additions and 21 deletions.
  1. +6 −21 railties/test/generators/app_generator_test.rb
View
27 railties/test/generators/app_generator_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.