mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update hash format for render_text_test
This commit is contained in:
parent
103e18c87d
commit
9e9cc66077
1 changed files with 18 additions and 18 deletions
|
@ -14,7 +14,7 @@ module RenderText
|
|||
self.view_paths = [ActionView::FixtureResolver.new]
|
||||
|
||||
def index
|
||||
render :text => "hello david"
|
||||
render text: "hello david"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -26,48 +26,48 @@ module RenderText
|
|||
)]
|
||||
|
||||
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 @@ module RenderText
|
|||
|
||||
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 @@ module RenderText
|
|||
|
||||
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 @@ module RenderText
|
|||
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"
|
||||
|
|
Loading…
Reference in a new issue