Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
9e9cc660
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9e9cc660
编写于
2月 07, 2014
作者:
P
Prem Sichanugrist
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update hash format for render_text_test
上级
103e18c8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
18 deletion
+18
-18
actionpack/test/controller/new_base/render_text_test.rb
actionpack/test/controller/new_base/render_text_test.rb
+18
-18
未找到文件。
actionpack/test/controller/new_base/render_text_test.rb
浏览文件 @
9e9cc660
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录