Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
2b3d67d6
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,发现更多精彩内容 >>
提交
2b3d67d6
编写于
10月 07, 2014
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17204 from schneems/schneems/fix-am-tests-master
fix tests on action_mailer
上级
4b8f0f8b
e6b0b760
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
9 addition
and
7 deletion
+9
-7
actionmailer/lib/action_mailer/test_case.rb
actionmailer/lib/action_mailer/test_case.rb
+1
-1
actionmailer/test/asset_host_test.rb
actionmailer/test/asset_host_test.rb
+2
-2
actionmailer/test/base_test.rb
actionmailer/test/base_test.rb
+4
-2
actionmailer/test/url_test.rb
actionmailer/test/url_test.rb
+2
-2
未找到文件。
actionmailer/lib/action_mailer/test_case.rb
浏览文件 @
2b3d67d6
...
...
@@ -16,7 +16,7 @@ module Behavior
include
ActiveSupport
::
Testing
::
ConstantLookup
include
TestHelper
include
Rails
::
Dom
::
Testing
::
Assertions
::
SelectorAssertions
include
Rails
::
Dom
::
Testing
::
Assertions
included
do
class_attribute
:_mailer_class
...
...
actionmailer/test/asset_host_test.rb
浏览文件 @
2b3d67d6
...
...
@@ -22,7 +22,7 @@ def teardown
def
test_asset_host_as_string
mail
=
AssetHostMailer
.
email_with_asset
assert_equal
%Q{<img alt="Somelogo" src="http://www.example.com/images/somelogo.png" />}
,
mail
.
body
.
to_s
.
strip
assert_
dom_
equal
%Q{<img alt="Somelogo" src="http://www.example.com/images/somelogo.png" />}
,
mail
.
body
.
to_s
.
strip
end
def
test_asset_host_as_one_argument_proc
...
...
@@ -32,6 +32,6 @@ def test_asset_host_as_one_argument_proc
end
}
mail
=
AssetHostMailer
.
email_with_asset
assert_equal
%Q{<img alt="Somelogo" src="http://images.example.com/images/somelogo.png" />}
,
mail
.
body
.
to_s
.
strip
assert_
dom_
equal
%Q{<img alt="Somelogo" src="http://images.example.com/images/somelogo.png" />}
,
mail
.
body
.
to_s
.
strip
end
end
actionmailer/test/base_test.rb
浏览文件 @
2b3d67d6
...
...
@@ -10,6 +10,8 @@
require
'mailers/asset_mailer'
class
BaseTest
<
ActiveSupport
::
TestCase
include
Rails
::
Dom
::
Testing
::
Assertions
setup
do
@original_delivery_method
=
ActionMailer
::
Base
.
delivery_method
ActionMailer
::
Base
.
delivery_method
=
:test
...
...
@@ -536,7 +538,7 @@ def welcome
mail
=
AssetMailer
.
welcome
assert_equal
(
%{<img alt="Dummy" src="http://global.com/images/dummy.png" />}
,
mail
.
body
.
to_s
.
strip
)
assert_
dom_
equal
(
%{<img alt="Dummy" src="http://global.com/images/dummy.png" />}
,
mail
.
body
.
to_s
.
strip
)
end
test
"assets tags should use a Mailer's asset_host settings when available"
do
...
...
@@ -550,7 +552,7 @@ def welcome
mail
=
TempAssetMailer
.
welcome
assert_equal
(
%{<img alt="Dummy" src="http://local.com/images/dummy.png" />}
,
mail
.
body
.
to_s
.
strip
)
assert_
dom_
equal
(
%{<img alt="Dummy" src="http://local.com/images/dummy.png" />}
,
mail
.
body
.
to_s
.
strip
)
end
test
'the view is not rendered when mail was never called'
do
...
...
actionmailer/test/url_test.rb
浏览文件 @
2b3d67d6
...
...
@@ -66,13 +66,13 @@ def test_signed_up_with_url
expected
.
message_id
=
'<123@456>'
created
.
message_id
=
'<123@456>'
assert_equal
expected
.
encoded
,
created
.
encoded
assert_
dom_
equal
expected
.
encoded
,
created
.
encoded
assert_nothing_raised
{
UrlTestMailer
.
signed_up_with_url
(
@recipient
).
deliver_now
}
assert_not_nil
ActionMailer
::
Base
.
deliveries
.
first
delivered
=
ActionMailer
::
Base
.
deliveries
.
first
delivered
.
message_id
=
'<123@456>'
assert_equal
expected
.
encoded
,
delivered
.
encoded
assert_
dom_
equal
expected
.
encoded
,
delivered
.
encoded
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录