提交 7f3847cc 编写于 作者: C Carlos Antonio da Silva 提交者: Santiago Pastorino

Add test to ensure setting config.generators.http_only actually disables the generator options

[Carlos Antonio da Silva & Santiago Pastorino]
上级 ff8e9e07
......@@ -126,7 +126,20 @@ def with_bare_config
end
end
test "http only allow overriding generators on initialization" do
test "http only disables options from generators" do
add_to_config <<-RUBY
config.generators.http_only!
RUBY
# Initialize the application
require "#{app_path}/config/environment"
Rails.application.load_generators
assert !Rails::Generators.options[:rails][:template_engine],
"http only should have disabled generator options"
end
test "http only allow overriding generators options" do
add_to_config <<-RUBY
config.generators.helper = true
config.generators.http_only!
......
......@@ -52,7 +52,7 @@ def app
], middleware
end
test "api middleware stack" do
test "http only middleware stack" do
add_to_config "config.middleware.http_only!"
add_to_config "config.force_ssl = true"
add_to_config "config.action_dispatch.x_sendfile_header = 'X-Sendfile'"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册