Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
8ae3d17c
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,发现更多精彩内容 >>
未验证
提交
8ae3d17c
编写于
6月 30, 2018
作者:
R
Ryuta Kamizono
提交者:
GitHub
6月 30, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #33263 from bogdanvlviv/follow-up-33258
Clarify activejob/lib/active_job/test_helper.rb
上级
e295e51b
58271f63
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
10 addition
and
4 deletion
+10
-4
activejob/lib/active_job/test_helper.rb
activejob/lib/active_job/test_helper.rb
+2
-2
activejob/test/cases/test_helper_test.rb
activejob/test/cases/test_helper_test.rb
+8
-2
未找到文件。
activejob/lib/active_job/test_helper.rb
浏览文件 @
8ae3d17c
...
...
@@ -322,8 +322,8 @@ def assert_enqueued_with(job: nil, args: nil, at: nil, queue: nil)
jobs
=
enqueued_jobs
end
matching_job
=
jobs
.
find
do
|
in_block
_job
|
serialized_args
.
all?
{
|
key
,
value
|
value
==
in_block
_job
[
key
]
}
matching_job
=
jobs
.
find
do
|
enqueued
_job
|
serialized_args
.
all?
{
|
key
,
value
|
value
==
enqueued
_job
[
key
]
}
end
assert
matching_job
,
"No enqueued job found with
#{
expected
}
"
...
...
activejob/test/cases/test_helper_test.rb
浏览文件 @
8ae3d17c
...
...
@@ -471,6 +471,12 @@ def test_assert_enqueued_with_with_no_block_args
end
end
def
test_assert_enqueued_with_with_at_option
assert_enqueued_with
(
job:
HelloJob
,
at:
Date
.
tomorrow
.
noon
)
do
HelloJob
.
set
(
wait_until:
Date
.
tomorrow
.
noon
).
perform_later
end
end
def
test_assert_enqueued_with_with_no_block_with_at_option
HelloJob
.
set
(
wait_until:
Date
.
tomorrow
.
noon
).
perform_later
assert_enqueued_with
(
job:
HelloJob
,
at:
Date
.
tomorrow
.
noon
)
...
...
@@ -501,7 +507,7 @@ def test_assert_enqueued_with_failure_with_global_id_args
assert_equal
"No enqueued job found with {:job=>HelloJob, :args=>[
#{
wilma
.
inspect
}
]}"
,
error
.
message
end
def
test_assert_enqueued_with_
with_
failure_with_no_block_with_global_id_args
def
test_assert_enqueued_with_failure_with_no_block_with_global_id_args
ricardo
=
Person
.
new
(
9
)
wilma
=
Person
.
new
(
11
)
error
=
assert_raise
ActiveSupport
::
TestCase
::
Assertion
do
...
...
@@ -512,7 +518,7 @@ def test_assert_enqueued_with_with_failure_with_no_block_with_global_id_args
assert_equal
"No enqueued job found with {:job=>HelloJob, :args=>[
#{
wilma
.
inspect
}
]}"
,
error
.
message
end
def
test_assert_enqueued_
job
_does_not_change_jobs_count
def
test_assert_enqueued_
with
_does_not_change_jobs_count
HelloJob
.
perform_later
assert_enqueued_with
(
job:
HelloJob
)
do
HelloJob
.
perform_later
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录