Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
391cfc20
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,发现更多精彩内容 >>
提交
391cfc20
编写于
9月 26, 2014
作者:
G
Godfrey Chan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix actionpack test cases broken by #16888
上级
b5571b3c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
29 deletion
+9
-29
actionpack/test/controller/new_base/render_file_test.rb
actionpack/test/controller/new_base/render_file_test.rb
+0
-29
actionpack/test/controller/new_base/render_template_test.rb
actionpack/test/controller/new_base/render_template_test.rb
+9
-0
未找到文件。
actionpack/test/controller/new_base/render_file_test.rb
浏览文件 @
391cfc20
...
...
@@ -13,15 +13,6 @@ def with_instance_variables
render
:file
=>
File
.
join
(
File
.
dirname
(
__FILE__
),
'../../fixtures/test/render_file_with_ivar'
)
end
def
without_file_key
render
File
.
join
(
File
.
dirname
(
__FILE__
),
*
%w[.. .. fixtures test hello_world]
)
end
def
without_file_key_with_instance_variable
@secret
=
'in the sauce'
render
File
.
join
(
File
.
dirname
(
__FILE__
),
'../../fixtures/test/render_file_with_ivar'
)
end
def
relative_path
@secret
=
'in the sauce'
render
:file
=>
'../../fixtures/test/render_file_with_ivar'
...
...
@@ -41,11 +32,6 @@ def with_locals
path
=
File
.
join
(
File
.
dirname
(
__FILE__
),
'../../fixtures/test/render_file_with_locals'
)
render
:file
=>
path
,
:locals
=>
{
:secret
=>
'in the sauce'
}
end
def
without_file_key_with_locals
path
=
FIXTURES
.
join
(
'test/render_file_with_locals'
).
to_s
render
path
,
:locals
=>
{
:secret
=>
'in the sauce'
}
end
end
class
TestBasic
<
Rack
::
TestCase
...
...
@@ -61,16 +47,6 @@ class TestBasic < Rack::TestCase
assert_response
"The secret is in the sauce
\n
"
end
test
"rendering path without specifying the :file key"
do
get
:without_file_key
assert_response
"Hello world!"
end
test
"rendering path without specifying the :file key with ivar"
do
get
:without_file_key_with_instance_variable
assert_response
"The secret is in the sauce
\n
"
end
test
"rendering a relative path"
do
get
:relative_path
assert_response
"The secret is in the sauce
\n
"
...
...
@@ -90,10 +66,5 @@ class TestBasic < Rack::TestCase
get
:with_locals
assert_response
"The secret is in the sauce
\n
"
end
test
"rendering path without specifying the :file key with locals"
do
get
:without_file_key_with_locals
assert_response
"The secret is in the sauce
\n
"
end
end
end
actionpack/test/controller/new_base/render_template_test.rb
浏览文件 @
391cfc20
...
...
@@ -45,6 +45,10 @@ def with_locals
render
:template
=>
"locals"
,
:locals
=>
{
:secret
=>
'area51'
}
end
def
with_locals_without_key
render
"locals"
,
:locals
=>
{
:secret
=>
'area51'
}
end
def
builder_template
render
:template
=>
"xml_template"
end
...
...
@@ -101,6 +105,11 @@ class TestWithoutLayout < Rack::TestCase
assert_response
"The secret is area51"
end
test
"rendering a template with local variables without key"
do
get
:with_locals
assert_response
"The secret is area51"
end
test
"rendering a builder template"
do
get
:builder_template
,
"format"
=>
"xml"
assert_response
"<html>
\n
<p>Hello</p>
\n
</html>
\n
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录