Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
e136fbd7
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 搜索 >>
提交
e136fbd7
编写于
7月 02, 2012
作者:
A
Aaron Patterson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
push the cookie writing stuff out of the controller
merging cookies is responsibility of the test runner
上级
4528cd0f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
23 deletion
+8
-23
actionpack/lib/action_controller/metal/testing.rb
actionpack/lib/action_controller/metal/testing.rb
+2
-23
actionpack/lib/action_controller/test_case.rb
actionpack/lib/action_controller/test_case.rb
+6
-0
未找到文件。
actionpack/lib/action_controller/metal/testing.rb
浏览文件 @
e136fbd7
...
...
@@ -4,33 +4,12 @@ module Testing
include
RackDelegation
# This gets included on the second request. We only want to modify this
# behavior on the second request. Ugh.
module
Recycled
# :nodoc:
def
set_response!
(
request
)
end
def
process
(
name
)
ret
=
super
if
cookies
=
@_request
.
env
[
'action_dispatch.cookies'
]
cookies
.
write
(
@_response
)
end
@_response
.
prepare!
ret
end
def
recycled?
true
end
end
def
recycled?
# :nodoc:
false
def
set_response!
(
request
)
super
unless
@_response
end
def
recycle!
@_url_options
=
nil
extend
Recycled
unless
recycled?
end
# TODO : Rewrite tests using controller.headers= to use Rack env
...
...
actionpack/lib/action_controller/test_case.rb
浏览文件 @
e136fbd7
...
...
@@ -499,8 +499,14 @@ def process(action, http_method = 'GET', *args)
@controller
.
recycle!
name
=
@request
.
parameters
[
:action
]
@controller
.
process
(
name
)
if
cookies
=
@request
.
env
[
'action_dispatch.cookies'
]
cookies
.
write
(
@response
)
end
@response
.
prepare!
@assigns
=
@controller
.
respond_to?
(
:view_assigns
)
?
@controller
.
view_assigns
:
{}
@request
.
session
.
delete
(
'flash'
)
if
@request
.
session
[
'flash'
].
blank?
@response
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录