aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/app_generator_test.rb
diff options
context:
space:
mode:
authorArun Agrawal <arunagw@gmail.com>2013-11-23 10:36:25 +0100
committerArun Agrawal <arunagw@gmail.com>2013-11-23 10:41:15 +0100
commit9725bff2f696b09be61455d7323452723905f7f1 (patch)
treee5b4029258f9503cebd9cb3a0a226a2907c4c0d6 /railties/test/generators/app_generator_test.rb
parent5542dff88a8581675c9324c8184cc80df99e3325 (diff)
downloadrails-9725bff2f696b09be61455d7323452723905f7f1.tar.gz
rails-9725bff2f696b09be61455d7323452723905f7f1.tar.bz2
rails-9725bff2f696b09be61455d7323452723905f7f1.zip
Cleaned up app generator test
Diffstat (limited to 'railties/test/generators/app_generator_test.rb')
-rw-r--r--railties/test/generators/app_generator_test.rb27
1 files changed, 6 insertions, 21 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 843b4da970..6f03cf3083 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -29,6 +29,7 @@ DEFAULT_APP_FILES = %w(
lib/tasks
lib/assets
log
+ test/test_helper.rb
test/fixtures
test/controllers
test/models
@@ -37,6 +38,8 @@ DEFAULT_APP_FILES = %w(
test/integration
vendor
vendor/assets
+ vendor/assets/stylesheets
+ vendor/assets/javascripts
tmp/cache
tmp/cache/assets
)
@@ -58,6 +61,7 @@ class AppGeneratorTest < Rails::Generators::TestCase
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 @@ class AppGeneratorTest < Rails::Generators::TestCase
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 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_file "Gemfile" do |content|
assert_no_match(/coffee-rails/, content)
+ assert_no_match(/jquery-rails/, content)
end
end