Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
efda2a7a
未验证
提交
efda2a7a
编辑于
1 year ago
作者:
Cody West
提交者:
Josianne Hyson
1 year ago
浏览文件
操作
下载
补丁
差异文件
Apply review suggestions
上级
67d4689b
Loading
Loading
加载中
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
spec/workers/users/deactivate_dormant_users_worker_spec.rb
+10
-16
10 个添加, 16 个删除
spec/workers/users/deactivate_dormant_users_worker_spec.rb
有
10 个添加
和
16 个删除
spec/workers/users/deactivate_dormant_users_worker_spec.rb
+
10
−
16
浏览文件 @
efda2a7a
...
...
@@ -21,17 +21,12 @@
end
shared_examples
'deactivates dormant users'
do
it
do
worker
.
perform
expect_any_instance_of
(
::
Users
::
DeactivateService
)
do
|
deactivation_service
|
expect
(
deactivation_service
).
to
receive
(
:execute
).
twice
.
and_call_original
expect
(
deactivation_service
).
to
have_received
(
:execute
).
with
(
dormant
)
expect
(
deactivation_service
).
to
have_received
(
:execute
).
with
(
inactive
)
end
expect
(
dormant
.
reload
).
to
be_deactivated
expect
(
inactive
.
reload
).
to
be_deactivated
specify
do
expect
{
worker
.
perform
}
.
to
change
{
dormant
.
reload
.
state
}
.
to
(
'deactivated'
)
.
and
change
{
inactive
.
reload
.
state
}
.
to
(
'deactivated'
)
end
end
...
...
@@ -50,15 +45,14 @@
end
with_them
do
it
do
specify
do
user
=
create
(
:user
,
user_type:
user_type
,
state: :active
,
last_activity_on:
Gitlab
::
CurrentSettings
.
deactivate_dormant_users_period
.
days
.
ago
.
to_date
)
worker
.
perform
expect_any_instance_of
(
::
Users
::
DeactivateService
)
do
|
deactivation_service
|
if
expected_state
==
'deactivated'
expect
(
deactivation_service
).
to
receive
(
:execute
).
and_call_original
expect
(
deactivation_service
).
to
have_received
(
:execute
).
with
(
user
)
expect
(
deactivation_service
).
to
receive
(
:execute
).
with
(
user
).
and_call_original
else
expect
(
deactivation_service
).
not_to
have_received
(
:execute
).
with
(
user
)
end
...
...
@@ -70,7 +64,7 @@
end
shared_examples
'does not deactivate non-active users'
do
it
do
specify
do
human_user
=
create
(
:user
,
user_type: :human
,
state: :blocked
,
last_activity_on:
Gitlab
::
CurrentSettings
.
deactivate_dormant_users_period
.
days
.
ago
.
to_date
)
service_user
=
create
(
:user
,
user_type: :service_user
,
state: :blocked
,
last_activity_on:
Gitlab
::
CurrentSettings
.
deactivate_dormant_users_period
.
days
.
ago
.
to_date
)
...
...
@@ -84,7 +78,7 @@
end
shared_examples
'does not deactivate recently created users'
do
it
do
specify
do
worker
.
perform
expect_any_instance_of
(
::
Users
::
DeactivateService
)
do
|
deactivation_service
|
...
...
此差异已折叠。
点击以展开。
GitLab CN Bot
@gitlab-cn-bot
mentioned in commit
e87d1faf
·
1 year ago
mentioned in commit
e87d1faf
mentioned in commit e87d1faf7e565edad60acce56c2b0e20308728a2
展开或隐藏提交列表
GitLab CN Bot
@gitlab-cn-bot
mentioned in commit
3bce060c
·
1 year ago
mentioned in commit
3bce060c
mentioned in commit 3bce060cbf076b00fcbf068f14d53f27cf39e20b
展开或隐藏提交列表
GitLab CN Bot
@gitlab-cn-bot
mentioned in commit
1994259b
·
1 year ago
mentioned in commit
1994259b
mentioned in commit 1994259b7cfe3f4ed9aefad9b52ca75913bfc001
展开或隐藏提交列表
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录