提交 9e9cc660 编写于 作者: P Prem Sichanugrist

Update hash format for render_text_test

上级 103e18c8
......@@ -14,7 +14,7 @@ class SimpleController < ActionController::Base
self.view_paths = [ActionView::FixtureResolver.new]
def index
render :text => "hello david"
render text: "hello david"
end
end
......@@ -26,48 +26,48 @@ class WithLayoutController < ::ApplicationController
)]
def index
render :text => "hello david"
render text: "hello david"
end
def custom_code
render :text => "hello world", :status => 404
render text: "hello world", status: 404
end
def with_custom_code_as_string
render :text => "hello world", :status => "404 Not Found"
render text: "hello world", status: "404 Not Found"
end
def with_nil
render :text => nil
render text: nil
end
def with_nil_and_status
render :text => nil, :status => 403
render text: nil, status: 403
end
def with_false
render :text => false
render text: false
end
def with_layout_true
render :text => "hello world", :layout => true
render text: "hello world", layout: true
end
def with_layout_false
render :text => "hello world", :layout => false
render text: "hello world", layout: false
end
def with_layout_nil
render :text => "hello world", :layout => nil
render text: "hello world", layout: nil
end
def with_custom_layout
render :text => "hello world", :layout => "greetings"
render text: "hello world", layout: "greetings"
end
def with_ivar_in_layout
@ivar = "hello world"
render :text => "hello world", :layout => "ivar"
render text: "hello world", layout: "ivar"
end
end
......@@ -80,7 +80,7 @@ class RenderTextTest < Rack::TestCase
test "rendering text from an action with default options renders the text with the layout" do
with_routing do |set|
set.draw { get ':controller', :action => 'index' }
set.draw { get ':controller', action: 'index' }
get "/render_text/simple"
assert_body "hello david"
......@@ -90,7 +90,7 @@ class RenderTextTest < Rack::TestCase
test "rendering text from an action with default options renders the text without the layout" do
with_routing do |set|
set.draw { get ':controller', :action => 'index' }
set.draw { get ':controller', action: 'index' }
get "/render_text/with_layout"
......@@ -127,28 +127,28 @@ class RenderTextTest < Rack::TestCase
assert_status 200
end
test "rendering text with :layout => true" do
test "rendering text with layout: true" do
get "/render_text/with_layout/with_layout_true"
assert_body "hello world, I'm here!"
assert_status 200
end
test "rendering text with :layout => 'greetings'" do
test "rendering text with layout: 'greetings'" do
get "/render_text/with_layout/with_custom_layout"
assert_body "hello world, I wish thee well."
assert_status 200
end
test "rendering text with :layout => false" do
test "rendering text with layout: false" do
get "/render_text/with_layout/with_layout_false"
assert_body "hello world"
assert_status 200
end
test "rendering text with :layout => nil" do
test "rendering text with layout: nil" do
get "/render_text/with_layout/with_layout_nil"
assert_body "hello world"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册