Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
84e94551
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,发现更多精彩内容 >>
提交
84e94551
编写于
10月 03, 2009
作者:
J
Joshua Peek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add custom "with_routing" to internal tests to fix reseting session after using
with_routing. This only affects our internal AP tests.
上级
89630a7c
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
30 addition
and
20 deletion
+30
-20
actionpack/test/abstract_unit.rb
actionpack/test/abstract_unit.rb
+27
-6
actionpack/test/activerecord/active_record_store_test.rb
actionpack/test/activerecord/active_record_store_test.rb
+0
-1
actionpack/test/controller/integration_test.rb
actionpack/test/controller/integration_test.rb
+1
-4
actionpack/test/controller/rescue_test.rb
actionpack/test/controller/rescue_test.rb
+0
-1
actionpack/test/controller/webservice_test.rb
actionpack/test/controller/webservice_test.rb
+0
-1
actionpack/test/dispatch/request/json_params_parsing_test.rb
actionpack/test/dispatch/request/json_params_parsing_test.rb
+0
-1
actionpack/test/dispatch/request/multipart_params_parsing_test.rb
...ck/test/dispatch/request/multipart_params_parsing_test.rb
+0
-1
actionpack/test/dispatch/request/query_string_parsing_test.rb
...onpack/test/dispatch/request/query_string_parsing_test.rb
+0
-1
actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
.../test/dispatch/request/url_encoded_params_parsing_test.rb
+0
-1
actionpack/test/dispatch/request/xml_params_parsing_test.rb
actionpack/test/dispatch/request/xml_params_parsing_test.rb
+0
-1
actionpack/test/dispatch/session/cookie_store_test.rb
actionpack/test/dispatch/session/cookie_store_test.rb
+0
-1
actionpack/test/dispatch/session/mem_cache_store_test.rb
actionpack/test/dispatch/session/mem_cache_store_test.rb
+0
-1
actionpack/test/lib/controller/fake_controllers.rb
actionpack/test/lib/controller/fake_controllers.rb
+1
-0
actionpack/test/view/test_case_test.rb
actionpack/test/view/test_case_test.rb
+1
-0
未找到文件。
actionpack/test/abstract_unit.rb
浏览文件 @
84e94551
...
@@ -53,12 +53,33 @@
...
@@ -53,12 +53,33 @@
FIXTURE_LOAD_PATH
=
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
)
FIXTURE_LOAD_PATH
=
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
)
class
ActionController::IntegrationTest
<
ActiveSupport
::
TestCase
class
ActionController::IntegrationTest
<
ActiveSupport
::
TestCase
@@app
=
ActionDispatch
::
MiddlewareStack
.
new
{
|
middleware
|
def
self
.
build_app
(
routes
=
nil
)
middleware
.
use
"ActionDispatch::ShowExceptions"
ActionDispatch
::
MiddlewareStack
.
new
{
|
middleware
|
middleware
.
use
"ActionDispatch::Callbacks"
middleware
.
use
"ActionDispatch::ShowExceptions"
middleware
.
use
"ActionDispatch::ParamsParser"
middleware
.
use
"ActionDispatch::Callbacks"
middleware
.
use
"Rack::Head"
middleware
.
use
"ActionDispatch::ParamsParser"
}.
build
(
ActionController
::
Routing
::
Routes
)
middleware
.
use
"Rack::Head"
}.
build
(
routes
||
ActionController
::
Routing
::
Routes
)
end
self
.
app
=
build_app
def
with_routing
(
&
block
)
real_routes
=
ActionController
::
Routing
::
Routes
ActionController
::
Routing
.
module_eval
{
remove_const
:Routes
}
temporary_routes
=
ActionController
::
Routing
::
RouteSet
.
new
self
.
class
.
app
=
self
.
class
.
build_app
(
temporary_routes
)
ActionController
::
Routing
.
module_eval
{
const_set
:Routes
,
temporary_routes
}
yield
temporary_routes
ensure
if
ActionController
::
Routing
.
const_defined?
:Routes
ActionController
::
Routing
.
module_eval
{
remove_const
:Routes
}
end
ActionController
::
Routing
.
const_set
(
:Routes
,
real_routes
)
if
real_routes
self
.
class
.
app
=
self
.
class
.
build_app
end
end
end
module
ActionView
module
ActionView
...
...
actionpack/test/activerecord/active_record_store_test.rb
浏览文件 @
84e94551
...
@@ -158,7 +158,6 @@ def with_test_route_set(options = {})
...
@@ -158,7 +158,6 @@ def with_test_route_set(options = {})
map
.
connect
"/:action"
,
:controller
=>
"active_record_store_test/test"
map
.
connect
"/:action"
,
:controller
=>
"active_record_store_test/test"
end
end
@app
=
ActiveRecord
::
SessionStore
.
new
(
set
,
options
.
reverse_merge
(
:key
=>
'_session_id'
))
@app
=
ActiveRecord
::
SessionStore
.
new
(
set
,
options
.
reverse_merge
(
:key
=>
'_session_id'
))
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/controller/integration_test.rb
浏览文件 @
84e94551
...
@@ -372,11 +372,8 @@ def test_generate_url_with_controller
...
@@ -372,11 +372,8 @@ def test_generate_url_with_controller
def
with_test_route_set
def
with_test_route_set
with_routing
do
|
set
|
with_routing
do
|
set
|
set
.
draw
do
|
map
|
set
.
draw
do
|
map
|
map
.
with_options
:controller
=>
"IntegrationProcessTest::Integration"
do
|
c
|
map
.
connect
"/:action"
,
:controller
=>
"integration_process_test/integration"
c
.
connect
"/:action"
end
end
end
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/controller/rescue_test.rb
浏览文件 @
84e94551
...
@@ -347,7 +347,6 @@ def with_test_routing
...
@@ -347,7 +347,6 @@ def with_test_routing
map
.
connect
'invalid'
,
:controller
=>
"rescue_test/test"
,
:action
=>
'invalid'
map
.
connect
'invalid'
,
:controller
=>
"rescue_test/test"
,
:action
=>
'invalid'
map
.
connect
'b00m'
,
:controller
=>
"rescue_test/test"
,
:action
=>
'b00m'
map
.
connect
'b00m'
,
:controller
=>
"rescue_test/test"
,
:action
=>
'b00m'
end
end
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/controller/webservice_test.rb
浏览文件 @
84e94551
...
@@ -259,7 +259,6 @@ def with_test_route_set
...
@@ -259,7 +259,6 @@ def with_test_route_set
c
.
connect
"/"
,
:action
=>
"assign_parameters"
c
.
connect
"/"
,
:action
=>
"assign_parameters"
end
end
end
end
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/dispatch/request/json_params_parsing_test.rb
浏览文件 @
84e94551
...
@@ -59,7 +59,6 @@ def with_test_routing
...
@@ -59,7 +59,6 @@ def with_test_routing
set
.
draw
do
|
map
|
set
.
draw
do
|
map
|
map
.
connect
':action'
,
:controller
=>
"json_params_parsing_test/test"
map
.
connect
':action'
,
:controller
=>
"json_params_parsing_test/test"
end
end
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/dispatch/request/multipart_params_parsing_test.rb
浏览文件 @
84e94551
...
@@ -153,7 +153,6 @@ def with_test_routing
...
@@ -153,7 +153,6 @@ def with_test_routing
set
.
draw
do
|
map
|
set
.
draw
do
|
map
|
map
.
connect
':action'
,
:controller
=>
"multipart_params_parsing_test/test"
map
.
connect
':action'
,
:controller
=>
"multipart_params_parsing_test/test"
end
end
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/dispatch/request/query_string_parsing_test.rb
浏览文件 @
84e94551
...
@@ -111,7 +111,6 @@ def assert_parses(expected, actual)
...
@@ -111,7 +111,6 @@ def assert_parses(expected, actual)
set
.
draw
do
|
map
|
set
.
draw
do
|
map
|
map
.
connect
':action'
,
:controller
=>
"query_string_parsing_test/test"
map
.
connect
':action'
,
:controller
=>
"query_string_parsing_test/test"
end
end
reset!
get
"/parse"
,
actual
get
"/parse"
,
actual
assert_response
:ok
assert_response
:ok
...
...
actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb
浏览文件 @
84e94551
...
@@ -132,7 +132,6 @@ def with_test_routing
...
@@ -132,7 +132,6 @@ def with_test_routing
set
.
draw
do
|
map
|
set
.
draw
do
|
map
|
map
.
connect
':action'
,
:controller
=>
"url_encoded_params_parsing_test/test"
map
.
connect
':action'
,
:controller
=>
"url_encoded_params_parsing_test/test"
end
end
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/dispatch/request/xml_params_parsing_test.rb
浏览文件 @
84e94551
...
@@ -86,7 +86,6 @@ def with_test_routing
...
@@ -86,7 +86,6 @@ def with_test_routing
set
.
draw
do
|
map
|
set
.
draw
do
|
map
|
map
.
connect
':action'
,
:controller
=>
"xml_params_parsing_test/test"
map
.
connect
':action'
,
:controller
=>
"xml_params_parsing_test/test"
end
end
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/dispatch/session/cookie_store_test.rb
浏览文件 @
84e94551
...
@@ -223,7 +223,6 @@ def with_test_route_set(options = {})
...
@@ -223,7 +223,6 @@ def with_test_route_set(options = {})
end
end
options
=
{
:key
=>
SessionKey
,
:secret
=>
SessionSecret
}.
merge
(
options
)
options
=
{
:key
=>
SessionKey
,
:secret
=>
SessionSecret
}.
merge
(
options
)
@app
=
ActionDispatch
::
Session
::
CookieStore
.
new
(
set
,
options
)
@app
=
ActionDispatch
::
Session
::
CookieStore
.
new
(
set
,
options
)
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/dispatch/session/mem_cache_store_test.rb
浏览文件 @
84e94551
...
@@ -115,7 +115,6 @@ def with_test_route_set
...
@@ -115,7 +115,6 @@ def with_test_route_set
map
.
connect
"/:action"
,
:controller
=>
"mem_cache_store_test/test"
map
.
connect
"/:action"
,
:controller
=>
"mem_cache_store_test/test"
end
end
@app
=
ActionDispatch
::
Session
::
MemCacheStore
.
new
(
set
,
:key
=>
'_session_id'
)
@app
=
ActionDispatch
::
Session
::
MemCacheStore
.
new
(
set
,
:key
=>
'_session_id'
)
reset!
yield
yield
end
end
end
end
...
...
actionpack/test/lib/controller/fake_controllers.rb
浏览文件 @
84e94551
...
@@ -18,6 +18,7 @@ class HiController < ActionController::Base; end
...
@@ -18,6 +18,7 @@ class HiController < ActionController::Base; end
class
BraveController
<
ActionController
::
Base
;
end
class
BraveController
<
ActionController
::
Base
;
end
class
ImageController
<
ActionController
::
Base
;
end
class
ImageController
<
ActionController
::
Base
;
end
class
WeblogController
<
ActionController
::
Base
;
end
class
WeblogController
<
ActionController
::
Base
;
end
class
BarController
<
ActionController
::
Base
;
end
# For speed test
# For speed test
class
SpeedController
<
ActionController
::
Base
;
end
class
SpeedController
<
ActionController
::
Base
;
end
...
...
actionpack/test/view/test_case_test.rb
浏览文件 @
84e94551
require
'abstract_unit'
require
'abstract_unit'
require
'controller/fake_controllers'
module
ActionView
module
ActionView
class
TestCase
class
TestCase
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录