Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
249622e7
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 搜索 >>
提交
249622e7
编写于
4月 01, 2019
作者:
S
Sharang Dashputre
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
url -> URL where apt inside actionpack/
上级
e0a9e025
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
24 addition
and
24 deletion
+24
-24
actionpack/lib/action_dispatch/routing/route_set.rb
actionpack/lib/action_dispatch/routing/route_set.rb
+1
-1
actionpack/test/controller/action_pack_assertions_test.rb
actionpack/test/controller/action_pack_assertions_test.rb
+1
-1
actionpack/test/controller/integration_test.rb
actionpack/test/controller/integration_test.rb
+3
-3
actionpack/test/controller/renderer_test.rb
actionpack/test/controller/renderer_test.rb
+2
-2
actionpack/test/controller/test_case_test.rb
actionpack/test/controller/test_case_test.rb
+1
-1
actionpack/test/dispatch/debug_exceptions_test.rb
actionpack/test/dispatch/debug_exceptions_test.rb
+1
-1
actionpack/test/dispatch/prefix_generation_test.rb
actionpack/test/dispatch/prefix_generation_test.rb
+5
-5
actionpack/test/dispatch/request_test.rb
actionpack/test/dispatch/request_test.rb
+1
-1
actionpack/test/dispatch/routing/route_set_test.rb
actionpack/test/dispatch/routing/route_set_test.rb
+3
-3
actionpack/test/dispatch/routing_test.rb
actionpack/test/dispatch/routing_test.rb
+6
-6
未找到文件。
actionpack/lib/action_dispatch/routing/route_set.rb
浏览文件 @
249622e7
...
...
@@ -333,7 +333,7 @@ def define_url_helper(mod, route, name, opts, route_key, url_strategy)
end
end
# strategy for building
url
s to send to the client
# strategy for building
URL
s to send to the client
PATH
=
->
(
options
)
{
ActionDispatch
::
Http
::
URL
.
path_for
(
options
)
}
UNKNOWN
=
->
(
options
)
{
ActionDispatch
::
Http
::
URL
.
url_for
(
options
)
}
...
...
actionpack/test/controller/action_pack_assertions_test.rb
浏览文件 @
249622e7
...
...
@@ -282,7 +282,7 @@ def test_assert_redirect_failure_message_with_protocol_relative_url
assert_no_match
(
/
#{
request
.
protocol
}#{
request
.
host
}
\/\/www.rubyonrails.org/
,
ex
.
message
,
"protocol relative
url
was incorrectly normalized"
"protocol relative
URL
was incorrectly normalized"
)
end
...
...
actionpack/test/controller/integration_test.rb
浏览文件 @
249622e7
...
...
@@ -808,17 +808,17 @@ def app
end
end
test
"session uses default
url
options from routes"
do
test
"session uses default
URL
options from routes"
do
assert_equal
"http://foo.com/foo"
,
foos_url
end
test
"current host overrides default
url
options from routes"
do
test
"current host overrides default
URL
options from routes"
do
get
"/foo"
assert_response
:success
assert_equal
"http://www.example.com/foo"
,
foos_url
end
test
"controller can override default
url
options from request"
do
test
"controller can override default
URL
options from request"
do
get
"/bar"
assert_response
:success
assert_equal
"http://bar.com/foo"
,
foos_url
...
...
actionpack/test/controller/renderer_test.rb
浏览文件 @
249622e7
...
...
@@ -115,14 +115,14 @@ class RendererTest < ActiveSupport::TestCase
assert_equal
"true"
,
content
end
test
"return valid asset
url
with defaults"
do
test
"return valid asset
URL
with defaults"
do
renderer
=
ApplicationController
.
renderer
content
=
renderer
.
render
inline:
"<%= asset_url 'asset.jpg' %>"
assert_equal
"http://example.org/asset.jpg"
,
content
end
test
"return valid asset
url
when https is true"
do
test
"return valid asset
URL
when https is true"
do
renderer
=
ApplicationController
.
renderer
.
new
https:
true
content
=
renderer
.
render
inline:
"<%= asset_url 'asset.jpg' %>"
...
...
actionpack/test/controller/test_case_test.rb
浏览文件 @
249622e7
...
...
@@ -952,7 +952,7 @@ def test_redirect_url_only_cares_about_location_header
get
:create
assert_response
:created
# Redirect
url
doesn't care that it wasn't a :redirect response.
# Redirect
URL
doesn't care that it wasn't a :redirect response.
assert_equal
"/resource"
,
@response
.
redirect_url
assert_equal
@response
.
redirect_url
,
redirect_to_url
...
...
actionpack/test/dispatch/debug_exceptions_test.rb
浏览文件 @
249622e7
...
...
@@ -341,7 +341,7 @@ def call(env)
assert_match
%r{NameError}
,
body
end
test
"named
url
s missing keys raise 500 level error"
do
test
"named
URL
s missing keys raise 500 level error"
do
@app
=
DevelopmentApp
get
"/missing_keys"
,
headers:
{
"action_dispatch.show_exceptions"
=>
true
}
...
...
actionpack/test/dispatch/prefix_generation_test.rb
浏览文件 @
249622e7
...
...
@@ -151,17 +151,17 @@ def setup
include
BlogEngine
.
routes
.
mounted_helpers
# Inside Engine
test
"[ENGINE] generating engine's
url
use SCRIPT_NAME from request"
do
test
"[ENGINE] generating engine's
URL
use SCRIPT_NAME from request"
do
get
"/pure-awesomeness/blog/posts/1"
assert_equal
"/pure-awesomeness/blog/posts/1"
,
response
.
body
end
test
"[ENGINE] generating application's
url
never uses SCRIPT_NAME from request"
do
test
"[ENGINE] generating application's
URL
never uses SCRIPT_NAME from request"
do
get
"/pure-awesomeness/blog/url_to_application"
assert_equal
"/generate"
,
response
.
body
end
test
"[ENGINE] generating engine's
url
with polymorphic path"
do
test
"[ENGINE] generating engine's
URL
with polymorphic path"
do
get
"/pure-awesomeness/blog/polymorphic_path_for_engine"
assert_equal
"/pure-awesomeness/blog/posts/1"
,
response
.
body
end
...
...
@@ -243,7 +243,7 @@ def setup
assert_equal
"/something/awesome/blog/posts/1"
,
response
.
body
end
test
"[APP] generating engine's
url
with polymorphic path"
do
test
"[APP] generating engine's
URL
with polymorphic path"
do
get
"/polymorphic_path_for_engine"
assert_equal
"/awesome/blog/posts/1"
,
response
.
body
end
...
...
@@ -253,7 +253,7 @@ def setup
assert_equal
"/posts/1"
,
response
.
body
end
test
"[APP] generating engine's
url
with url_for(@post)"
do
test
"[APP] generating engine's
URL
with url_for(@post)"
do
get
"/polymorphic_with_url_for"
assert_equal
"http://www.example.com/awesome/blog/posts/1"
,
response
.
body
end
...
...
actionpack/test/dispatch/request_test.rb
浏览文件 @
249622e7
...
...
@@ -411,7 +411,7 @@ class RequestPath < BaseRequestTest
assert_equal
"/foo?bar"
,
path
end
test
"original_url returns
url
built using ORIGINAL_FULLPATH"
do
test
"original_url returns
URL
built using ORIGINAL_FULLPATH"
do
request
=
stub_request
(
"ORIGINAL_FULLPATH"
=>
"/foo?bar"
,
"HTTP_HOST"
=>
"example.org"
,
"rack.url_scheme"
=>
"http"
)
...
...
actionpack/test/dispatch/routing/route_set_test.rb
浏览文件 @
249622e7
...
...
@@ -29,7 +29,7 @@ def call(env)
assert_not
empty?
end
test
"
url
helpers are added when route is added"
do
test
"
URL
helpers are added when route is added"
do
draw
do
get
"foo"
,
to:
SimpleApp
.
new
(
"foo#index"
)
end
...
...
@@ -48,7 +48,7 @@ def call(env)
assert_equal
"/bar"
,
url_helpers
.
bar_path
end
test
"
url
helpers are updated when route is updated"
do
test
"
URL
helpers are updated when route is updated"
do
draw
do
get
"bar"
,
to:
SimpleApp
.
new
(
"bar#index"
),
as: :bar
end
...
...
@@ -62,7 +62,7 @@ def call(env)
assert_equal
"/baz"
,
url_helpers
.
bar_path
end
test
"
url
helpers are removed when route is removed"
do
test
"
URL
helpers are removed when route is removed"
do
draw
do
get
"foo"
,
to:
SimpleApp
.
new
(
"foo#index"
)
get
"bar"
,
to:
SimpleApp
.
new
(
"bar#index"
)
...
...
actionpack/test/dispatch/routing_test.rb
浏览文件 @
249622e7
...
...
@@ -4392,7 +4392,7 @@ def app; APP end
include
Routes
.
url_helpers
test
"
url
helpers do not ignore nil parameters when using non-optimized routes"
do
test
"
URL
helpers do not ignore nil parameters when using non-optimized routes"
do
Routes
.
stub
:optimize_routes_generation?
,
false
do
get
"/categories/1"
assert_response
:success
...
...
@@ -4764,7 +4764,7 @@ def app; APP end
include
Routes
.
url_helpers
test
"
url
helpers raise a 'missing keys' error for a nil param with optimized helpers"
do
test
"
URL
helpers raise a 'missing keys' error for a nil param with optimized helpers"
do
url
,
missing
=
{
action:
"show"
,
controller:
"products"
,
id:
nil
},
[
:id
]
message
=
"No route matches
#{
url
.
inspect
}
, missing required keys:
#{
missing
.
inspect
}
"
...
...
@@ -4772,7 +4772,7 @@ def app; APP end
assert_equal
message
,
error
.
message
end
test
"
url
helpers raise a 'constraint failure' error for a nil param with non-optimized helpers"
do
test
"
URL
helpers raise a 'constraint failure' error for a nil param with non-optimized helpers"
do
url
,
missing
=
{
action:
"show"
,
controller:
"products"
,
id:
nil
},
[
:id
]
message
=
"No route matches
#{
url
.
inspect
}
, possible unmatched constraints:
#{
missing
.
inspect
}
"
...
...
@@ -4780,15 +4780,15 @@ def app; APP end
assert_equal
message
,
error
.
message
end
test
"
url
helpers raise message with mixed parameters when generation fails"
do
test
"
URL
helpers raise message with mixed parameters when generation fails"
do
url
,
missing
=
{
action:
"show"
,
controller:
"products"
,
id:
nil
,
"id"
=>
"url-tested"
},
[
:id
]
message
=
"No route matches
#{
url
.
inspect
}
, possible unmatched constraints:
#{
missing
.
inspect
}
"
# Optimized
url
helper
# Optimized
URL
helper
error
=
assert_raises
(
ActionController
::
UrlGenerationError
)
{
product_path
(
nil
,
"id"
=>
"url-tested"
)
}
assert_equal
message
,
error
.
message
# Non-optimized
url
helper
# Non-optimized
URL
helper
error
=
assert_raises
(
ActionController
::
UrlGenerationError
,
message
)
{
product_path
(
id:
nil
,
"id"
=>
"url-tested"
)
}
assert_equal
message
,
error
.
message
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录