Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
05407815
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,发现更多精彩内容 >>
提交
05407815
编写于
9月 19, 2009
作者:
J
Joshua Peek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Namespace TestControllers inside their test case class
上级
db0af807
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
216 addition
and
199 deletion
+216
-199
actionpack/test/controller/render_js_test.rb
actionpack/test/controller/render_js_test.rb
+21
-17
actionpack/test/controller/render_json_test.rb
actionpack/test/controller/render_json_test.rb
+31
-27
actionpack/test/controller/render_other_test.rb
actionpack/test/controller/render_other_test.rb
+128
-123
actionpack/test/controller/render_xml_test.rb
actionpack/test/controller/render_xml_test.rb
+36
-32
未找到文件。
actionpack/test/controller/render_js_test.rb
浏览文件 @
05407815
...
...
@@ -2,9 +2,14 @@
require
'controller/fake_models'
require
'pathname'
class
TestController
<
ActionController
::
Base
class
RenderJSTest
<
ActionController
::
TestCase
class
TestController
<
ActionController
::
Base
protect_from_forgery
def
self
.
controller_path
'test'
end
def
render_vanilla_js_hello
render
:js
=>
"alert('hello')"
end
...
...
@@ -16,9 +21,8 @@ def greeting
def
show_partial
render
:partial
=>
'partial'
end
end
end
class
RenderTest
<
ActionController
::
TestCase
tests
TestController
def
test_render_vanilla_js
...
...
actionpack/test/controller/render_json_test.rb
浏览文件 @
05407815
...
...
@@ -2,9 +2,14 @@
require
'controller/fake_models'
require
'pathname'
class
TestController
<
ActionController
::
Base
class
RenderJsonTest
<
ActionController
::
TestCase
class
TestController
<
ActionController
::
Base
protect_from_forgery
def
self
.
controller_path
'test'
end
def
render_json_nil
render
:json
=>
nil
end
...
...
@@ -28,9 +33,8 @@ def render_symbol_json
def
render_json_with_render_to_string
render
:json
=>
{
:hello
=>
render_to_string
(
:partial
=>
'partial'
)}
end
end
end
class
RenderTest
<
ActionController
::
TestCase
tests
TestController
def
setup
...
...
actionpack/test/controller/render_other_test.rb
浏览文件 @
05407815
...
...
@@ -2,8 +2,14 @@
require
'controller/fake_models'
require
'pathname'
class
TestController
<
ActionController
::
Base
class
RenderOtherTest
<
ActionController
::
TestCase
class
TestController
<
ActionController
::
Base
protect_from_forgery
def
self
.
controller_path
'test'
end
layout
:determine_layout
module
RenderTestHelper
...
...
@@ -103,7 +109,7 @@ def render_alternate_default
end
end
private
private
def
default_render
if
@alternate_default_render
@alternate_default_render
.
call
...
...
@@ -132,9 +138,8 @@ def determine_layout
(
request
.
xhr?
?
'layouts/xhr'
:
'layouts/standard'
)
end
end
end
end
class
RenderTest
<
ActionController
::
TestCase
tests
TestController
def
setup
...
...
@@ -153,7 +158,7 @@ def test_enum_rjs_test
$$(".product").each(function(value, index) {
new Effect.Highlight(element,{});
new Effect.Highlight(value,{});
Sortable.create(value, {onUpdate:function(){new Ajax.Request('/test/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize(value) + '&authenticity_token=' + encodeURIComponent('asdf')})}});
Sortable.create(value, {onUpdate:function(){new Ajax.Request('/
render_other_test/
test/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize(value) + '&authenticity_token=' + encodeURIComponent('asdf')})}});
new Draggable(value, {});
});
}
.
gsub
(
/^ /
,
''
).
strip
...
...
actionpack/test/controller/render_xml_test.rb
浏览文件 @
05407815
...
...
@@ -2,9 +2,14 @@
require
'controller/fake_models'
require
'pathname'
class
TestController
<
ActionController
::
Base
class
RenderXmlTest
<
ActionController
::
TestCase
class
TestController
<
ActionController
::
Base
protect_from_forgery
def
self
.
controller_path
'test'
end
def
render_with_location
render
:xml
=>
"<hello/>"
,
:location
=>
"http://example.com"
,
:status
=>
201
end
...
...
@@ -30,9 +35,8 @@ def formatted_xml_erb
def
render_xml_with_custom_content_type
render
:xml
=>
"<blah/>"
,
:content_type
=>
"application/atomsvc+xml"
end
end
end
class
RenderTest
<
ActionController
::
TestCase
tests
TestController
def
setup
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录