Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
1e6612ef
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,发现更多精彩内容 >>
提交
1e6612ef
编写于
7月 19, 2010
作者:
P
Piotr Sarnacki
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ensure that url_helpers included after application's ones have higher priority
上级
6c95e0f8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
0 deletion
+15
-0
actionpack/test/dispatch/prefix_generation_test.rb
actionpack/test/dispatch/prefix_generation_test.rb
+15
-0
未找到文件。
actionpack/test/dispatch/prefix_generation_test.rb
浏览文件 @
1e6612ef
...
...
@@ -14,6 +14,7 @@ def self.routes
match
"/posts"
,
:to
=>
"inside_engine_generating#index"
,
:as
=>
:posts
match
"/url_to_application"
,
:to
=>
"inside_engine_generating#url_to_application"
match
"/polymorphic_path_for_engine"
,
:to
=>
"inside_engine_generating#polymorphic_path_for_engine"
match
"/conflicting_url"
,
:to
=>
"inside_engine_generating#conflicting"
end
routes
...
...
@@ -37,6 +38,7 @@ def self.routes
match
"/generate"
,
:to
=>
"outside_engine_generating#index"
match
"/polymorphic_path_for_engine"
,
:to
=>
"outside_engine_generating#polymorphic_path_for_engine"
match
"/polymorphic_with_url_for"
,
:to
=>
"outside_engine_generating#polymorphic_with_url_for"
match
"/conflicting_url"
,
:to
=>
"outside_engine_generating#conflicting"
root
:to
=>
"outside_engine_generating#index"
end
...
...
@@ -90,6 +92,10 @@ def url_to_application
def
polymorphic_path_for_engine
render
:text
=>
polymorphic_path
(
Post
.
new
)
end
def
conflicting
render
:text
=>
"engine"
end
end
class
::
OutsideEngineGeneratingController
<
ActionController
::
Base
...
...
@@ -106,6 +112,10 @@ def polymorphic_path_for_engine
def
polymorphic_with_url_for
render
:text
=>
blog_engine
.
url_for
(
Post
.
new
)
end
def
conflicting
render
:text
=>
"application"
end
end
class
EngineObject
...
...
@@ -162,6 +172,11 @@ def setup
assert_equal
"/pure-awesomeness/blog/posts/1"
,
last_response
.
body
end
test
"[ENGINE] url_helpers from engine have higher priotity than application's url_helpers"
do
get
"/awesome/blog/conflicting_url"
assert_equal
"engine"
,
last_response
.
body
end
# Inside Application
test
"[APP] generating engine's route includes prefix"
do
get
"/generate"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录