Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
c15bb490
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,发现更多精彩内容 >>
提交
c15bb490
编写于
8月 06, 2010
作者:
P
Piotr Sarnacki
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed routes to use new API in a few more actionpack tests
上级
442e5496
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
56 addition
and
18 deletion
+56
-18
actionpack/test/controller/new_base/content_type_test.rb
actionpack/test/controller/new_base/content_type_test.rb
+9
-3
actionpack/test/controller/new_base/render_template_test.rb
actionpack/test/controller/new_base/render_template_test.rb
+7
-3
actionpack/test/controller/new_base/render_test.rb
actionpack/test/controller/new_base/render_test.rb
+17
-5
actionpack/test/controller/new_base/render_text_test.rb
actionpack/test/controller/new_base/render_text_test.rb
+14
-6
actionpack/test/controller/test_test.rb
actionpack/test/controller/test_test.rb
+9
-1
未找到文件。
actionpack/test/controller/new_base/content_type_test.rb
浏览文件 @
c15bb490
...
...
@@ -42,10 +42,16 @@ def set_as_nil_on_response_obj
class
ExplicitContentTypeTest
<
Rack
::
TestCase
test
"default response is HTML and UTF8"
do
get
"/content_type/base"
with_routing
do
|
set
|
set
.
draw
do
match
':controller'
,
:action
=>
'index'
end
assert_body
"Hello world!"
assert_header
"Content-Type"
,
"text/html; charset=utf-8"
get
"/content_type/base"
assert_body
"Hello world!"
assert_header
"Content-Type"
,
"text/html; charset=utf-8"
end
end
test
"setting the content type of the response directly on the response object"
do
...
...
actionpack/test/controller/new_base/render_template_test.rb
浏览文件 @
c15bb490
...
...
@@ -123,10 +123,14 @@ class TestWithLayout < Rack::TestCase
describe
"Rendering with :template using implicit or explicit layout"
test
"rendering with implicit layout"
do
get
"/render_template/with_layout"
with_routing
do
|
set
|
set
.
draw
{
match
':controller'
,
:action
=>
:index
}
assert_body
"Hello from basic.html.erb, I'm here!"
assert_status
200
get
"/render_template/with_layout"
assert_body
"Hello from basic.html.erb, I'm here!"
assert_status
200
end
end
test
"rendering with layout => :true"
do
...
...
actionpack/test/controller/new_base/render_test.rb
浏览文件 @
c15bb490
...
...
@@ -37,15 +37,27 @@ def index
class
RenderTest
<
Rack
::
TestCase
test
"render with blank"
do
get
"/render/blank_render"
with_routing
do
|
set
|
set
.
draw
do
match
":controller"
,
:action
=>
'index'
end
assert_body
"Hello world!"
assert_status
200
get
"/render/blank_render"
assert_body
"Hello world!"
assert_status
200
end
end
test
"rendering more than once raises an exception"
do
assert_raises
(
AbstractController
::
DoubleRenderError
)
do
get
"/render/double_render"
,
{},
"action_dispatch.show_exceptions"
=>
false
with_routing
do
|
set
|
set
.
draw
do
match
":controller"
,
:action
=>
'index'
end
assert_raises
(
AbstractController
::
DoubleRenderError
)
do
get
"/render/double_render"
,
{},
"action_dispatch.show_exceptions"
=>
false
end
end
end
end
...
...
actionpack/test/controller/new_base/render_text_test.rb
浏览文件 @
c15bb490
...
...
@@ -66,16 +66,24 @@ class RenderTextTest < Rack::TestCase
describe
"Rendering text using render :text"
test
"rendering text from a action with default options renders the text with the layout"
do
get
"/render_text/simple"
assert_body
"hello david"
assert_status
200
with_routing
do
|
set
|
set
.
draw
{
match
':controller'
,
:action
=>
'index'
}
get
"/render_text/simple"
assert_body
"hello david"
assert_status
200
end
end
test
"rendering text from a action with default options renders the text without the layout"
do
get
"/render_text/with_layout"
with_routing
do
|
set
|
set
.
draw
{
match
':controller'
,
:action
=>
'index'
}
assert_body
"hello david"
assert_status
200
get
"/render_text/with_layout"
assert_body
"hello david"
assert_status
200
end
end
test
"rendering text, while also providing a custom status code"
do
...
...
actionpack/test/controller/test_test.rb
浏览文件 @
c15bb490
...
...
@@ -465,7 +465,15 @@ def test_assert_routing_with_method
end
def
test_assert_routing_in_module
assert_routing
'admin/user'
,
:controller
=>
'admin/user'
,
:action
=>
'index'
with_routing
do
|
set
|
set
.
draw
do
namespace
:admin
do
match
'user'
=>
'user#index'
end
end
assert_routing
'admin/user'
,
:controller
=>
'admin/user'
,
:action
=>
'index'
end
end
def
test_assert_routing_with_glob
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录