Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
d9b732fc
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,发现更多精彩内容 >>
提交
d9b732fc
编写于
12月 18, 2010
作者:
P
Piotr Sarnacki
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests in railties
上级
4eb0d580
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
13 deletion
+13
-13
railties/test/railties/engine_test.rb
railties/test/railties/engine_test.rb
+10
-10
railties/test/railties/railtie_test.rb
railties/test/railties/railtie_test.rb
+3
-3
未找到文件。
railties/test/railties/engine_test.rb
浏览文件 @
d9b732fc
...
...
@@ -90,7 +90,7 @@ class Engine < ::Rails::Engine
env
=
Rack
::
MockRequest
.
env_for
(
"/bukkits"
)
response
=
Rails
.
application
.
call
(
env
)
assert_equal
[
"HELLO WORLD"
],
response
[
2
]
assert_equal
rack_body
([
"HELLO WORLD"
]),
rack_body
(
response
[
2
])
end
test
"it provides routes as default endpoint"
do
...
...
@@ -117,7 +117,7 @@ class Engine < ::Rails::Engine
env
=
Rack
::
MockRequest
.
env_for
(
"/bukkits/foo"
)
response
=
Rails
.
application
.
call
(
env
)
assert_equal
[
"foo"
],
response
[
2
]
assert_equal
rack_body
([
"foo"
]),
rack_body
(
response
[
2
])
end
test
"engine can load its own plugins"
do
...
...
@@ -357,15 +357,15 @@ def bar
env
=
Rack
::
MockRequest
.
env_for
(
"/foo"
)
response
=
Rails
.
application
.
call
(
env
)
assert_equal
[
"Something... Something... Something..."
],
response
[
2
]
assert_equal
rack_body
([
"Something... Something... Something..."
]),
rack_body
(
response
[
2
])
env
=
Rack
::
MockRequest
.
env_for
(
"/foo/show"
)
response
=
Rails
.
application
.
call
(
env
)
assert_equal
[
"/foo"
],
response
[
2
]
assert_equal
rack_body
([
"/foo"
]),
rack_body
(
response
[
2
])
env
=
Rack
::
MockRequest
.
env_for
(
"/foo/bar"
)
response
=
Rails
.
application
.
call
(
env
)
assert_equal
[
"It's a bar."
],
response
[
2
]
assert_equal
rack_body
([
"It's a bar."
]),
rack_body
(
response
[
2
])
end
test
"isolated engine should include only its own routes and helpers"
do
...
...
@@ -466,23 +466,23 @@ class MyMailer < ActionMailer::Base
env
=
Rack
::
MockRequest
.
env_for
(
"/bukkits/from_app"
)
response
=
AppTemplate
::
Application
.
call
(
env
)
assert_equal
[
"false"
],
response
[
2
]
assert_equal
rack_body
([
"false"
]),
rack_body
(
response
[
2
])
env
=
Rack
::
MockRequest
.
env_for
(
"/bukkits/foo/show"
)
response
=
AppTemplate
::
Application
.
call
(
env
)
assert_equal
[
"/bukkits/foo"
],
response
[
2
]
assert_equal
rack_body
([
"/bukkits/foo"
]),
rack_body
(
response
[
2
])
env
=
Rack
::
MockRequest
.
env_for
(
"/bukkits/foo"
)
response
=
AppTemplate
::
Application
.
call
(
env
)
assert_equal
[
"Helped."
],
response
[
2
]
assert_equal
rack_body
([
"Helped."
]),
rack_body
(
response
[
2
])
env
=
Rack
::
MockRequest
.
env_for
(
"/bukkits/routes_helpers_in_view"
)
response
=
AppTemplate
::
Application
.
call
(
env
)
assert_equal
[
"/bukkits/foo, /bar"
],
response
[
2
]
assert_equal
rack_body
([
"/bukkits/foo, /bar"
]),
rack_body
(
response
[
2
])
env
=
Rack
::
MockRequest
.
env_for
(
"/bukkits/polymorphic_path_without_namespace"
)
response
=
AppTemplate
::
Application
.
call
(
env
)
assert_equal
[
"/bukkits/posts/1"
],
response
[
2
]
assert_equal
rack_body
([
"/bukkits/posts/1"
]),
rack_body
(
response
[
2
])
end
test
"isolated engine should avoid namespace in names if that's possible"
do
...
...
railties/test/railties/railtie_test.rb
浏览文件 @
d9b732fc
...
...
@@ -21,10 +21,10 @@ def app
test
"Railtie provides railtie_name"
do
begin
class
::
Foo
<
Rails
::
Railtie
;
end
assert_equal
"foo
"
,
::
Foo
.
railtie_name
class
::
Foo
BarBaz
<
Rails
::
Railtie
;
end
assert_equal
"foo
_bar_baz"
,
::
FooBarBaz
.
railtie_name
ensure
Object
.
send
(
:remove_const
,
:"Foo"
)
Object
.
send
(
:remove_const
,
:"Foo
BarBaz
"
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录