Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
dcf1441c
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,发现更多精彩内容 >>
提交
dcf1441c
编写于
3月 15, 2010
作者:
A
Aaron Patterson
提交者:
wycats
3月 15, 2010
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
removing dead code from activerecord tests. [#4187 state:resolved]
Signed-off-by:
N
wycats
<
wycats@gmail.com
>
上级
1def1430
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
46 deletion
+0
-46
activerecord/test/cases/associations/has_one_associations_test.rb
...cord/test/cases/associations/has_one_associations_test.rb
+0
-9
activerecord/test/cases/associations/join_model_test.rb
activerecord/test/cases/associations/join_model_test.rb
+0
-12
activerecord/test/cases/reflection_test.rb
activerecord/test/cases/reflection_test.rb
+0
-6
activerecord/test/cases/validations/i18n_validation_test.rb
activerecord/test/cases/validations/i18n_validation_test.rb
+0
-19
未找到文件。
activerecord/test/cases/associations/has_one_associations_test.rb
浏览文件 @
dcf1441c
...
...
@@ -186,15 +186,6 @@ def test_succesful_build_association
assert_equal
account
,
firm
.
account
end
def
test_failing_build_association
firm
=
Firm
.
new
(
"name"
=>
"GlobalMegaCorp"
)
firm
.
save
account
=
firm
.
build_account
assert
!
account
.
save
assert_equal
[
"can't be empty"
],
account
.
errors
[
"credit_limit"
]
end
def
test_build_association_twice_without_saving_affects_nothing
count_of_account
=
Account
.
count
firm
=
Firm
.
find
(
:first
)
...
...
activerecord/test/cases/associations/join_model_test.rb
浏览文件 @
dcf1441c
...
...
@@ -52,18 +52,6 @@ def test_has_many_uniq_through_dynamic_find
assert_equal
1
,
authors
(
:mary
).
unique_categorized_posts
.
find_all_by_title
(
"So I was thinking"
).
size
end
def
test_polymorphic_has_many
assert
posts
(
:welcome
).
taggings
.
include?
(
taggings
(
:welcome_general
))
end
def
test_polymorphic_has_one
assert_equal
taggings
(
:welcome_general
),
posts
(
:welcome
).
tagging
end
def
test_polymorphic_belongs_to
assert_equal
posts
(
:welcome
),
posts
(
:welcome
).
taggings
.
first
.
taggable
end
def
test_polymorphic_has_many_going_through_join_model
assert_equal
tags
(
:general
),
tag
=
posts
(
:welcome
).
tags
.
first
assert_no_queries
do
...
...
activerecord/test/cases/reflection_test.rb
浏览文件 @
dcf1441c
...
...
@@ -22,12 +22,6 @@ def test_human_name
assert_equal
"Subscriber"
,
Subscriber
.
model_name
.
human
end
def
test_column_null_not_null
subscriber
=
Subscriber
.
find
(
:first
)
assert
subscriber
.
column_for_attribute
(
"name"
).
null
assert
!
subscriber
.
column_for_attribute
(
"nick"
).
null
end
def
test_read_attribute_names
assert_equal
(
%w( id title author_name author_email_address bonus_time written_on last_read content approved replies_count parent_id parent_title type )
.
sort
,
...
...
activerecord/test/cases/validations/i18n_validation_test.rb
浏览文件 @
dcf1441c
...
...
@@ -47,25 +47,6 @@ def test_validates_uniqueness_of_generates_message_with_custom_default_message
@topic
.
valid?
end
# validates_uniqueness_of w/o mocha
def
test_validates_associated_finds_custom_model_key_translation
I18n
.
backend
.
store_translations
'en'
,
:activerecord
=>
{
:errors
=>
{
:models
=>
{
:topic
=>
{
:attributes
=>
{
:title
=>
{
:taken
=>
'custom message'
}}}}}}
I18n
.
backend
.
store_translations
'en'
,
:activerecord
=>
{
:errors
=>
{
:messages
=>
{
:taken
=>
'global message'
}}}
Topic
.
validates_uniqueness_of
:title
unique_topic
.
valid?
assert_equal
[
'custom message'
],
unique_topic
.
errors
[
:replies
]
end
def
test_validates_associated_finds_global_default_translation
I18n
.
backend
.
store_translations
'en'
,
:activerecord
=>
{
:errors
=>
{
:messages
=>
{
:taken
=>
'global message'
}}}
Topic
.
validates_uniqueness_of
:title
unique_topic
.
valid?
assert_equal
[
'global message'
],
unique_topic
.
errors
[
:replies
]
end
# validates_associated w/ mocha
def
test_validates_associated_generates_message
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录