aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators_test.rb
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-03-10 16:36:17 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2012-03-14 12:46:24 -0300
commitc825e9a5eaa8060a3745c5275b6829c37c6545a7 (patch)
treec8537c3733f588e9198426de860c59bd4a2ae9a3 /railties/test/generators_test.rb
parent124838b508f0375ba75e09a698f6e43f24ec268d (diff)
downloadrails-c825e9a5eaa8060a3745c5275b6829c37c6545a7.tar.gz
rails-c825e9a5eaa8060a3745c5275b6829c37c6545a7.tar.bz2
rails-c825e9a5eaa8060a3745c5275b6829c37c6545a7.zip
Create generators http_only! setup and hide some common namespaces for now
[Carlos Antonio da Silva & Santiago Pastorino]
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r--railties/test/generators_test.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb
index 60e7e57a91..44797a6ac8 100644
--- a/railties/test/generators_test.rb
+++ b/railties/test/generators_test.rb
@@ -213,4 +213,28 @@ class GeneratorsTest < Rails::Generators::TestCase
Rails::Generators.hide_namespace("special:namespace")
assert Rails::Generators.hidden_namespaces.include?("special:namespace")
end
+
+ def test_http_only_hides_generators
+ generators = %w(assets js css session_migration)
+
+ generators.each do |generator|
+ assert !Rails::Generators.hidden_namespaces.include?(generator)
+ end
+
+ with_http_only! do
+ generators.each do |generator|
+ assert Rails::Generators.hidden_namespaces.include?(generator),
+ "http only should hide #{generator} generator"
+ end
+ end
+ end
+
+ private
+
+ def with_http_only!
+ Rails::Generators.http_only!
+ yield
+ ensure
+ Rails::Generators.instance_variable_set(:@http_only, false)
+ end
end