Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d7b74a28
Commit
d7b74a28
authored
Feb 02, 2021
by
Vladimir Shushlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up pages delete service specs
This feature flag was removed a long time ago
parent
7bf372c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
24 deletions
+14
-24
spec/services/pages/delete_services_spec.rb
spec/services/pages/delete_services_spec.rb
+14
-24
No files found.
spec/services/pages/delete_services_spec.rb
View file @
d7b74a28
...
...
@@ -3,35 +3,25 @@
require
'spec_helper'
RSpec
.
describe
Pages
::
DeleteService
do
shared_examples
'remove pages'
do
let_it_be
(
:project
)
{
create
(
:project
,
path:
"my.project"
)}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:domain
)
{
create
(
:pages_domain
,
project:
project
)
}
let_it_be
(
:service
)
{
described_class
.
new
(
project
,
admin
)}
let_it_be
(
:project
)
{
create
(
:project
,
path:
"my.project"
)}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:domain
)
{
create
(
:pages_domain
,
project:
project
)
}
let_it_be
(
:service
)
{
described_class
.
new
(
project
,
admin
)}
it
'deletes published pages'
do
expect_any_instance_of
(
Gitlab
::
PagesTransfer
).
to
receive
(
:rename_project
).
and_return
true
expect
(
PagesWorker
).
to
receive
(
:perform_in
).
with
(
5
.
minutes
,
:remove
,
project
.
namespace
.
full_path
,
anything
)
it
'deletes published pages'
do
expect_any_instance_of
(
Gitlab
::
PagesTransfer
).
to
receive
(
:rename_project
).
and_return
true
expect
(
PagesWorker
).
to
receive
(
:perform_in
).
with
(
5
.
minutes
,
:remove
,
project
.
namespace
.
full_path
,
anything
)
Sidekiq
::
Testing
.
inline!
{
service
.
execute
}
Sidekiq
::
Testing
.
inline!
{
service
.
execute
}
expect
(
project
.
reload
.
pages_metadatum
.
deployed?
).
to
be
(
false
)
end
it
'deletes all domains'
do
expect
(
project
.
pages_domains
.
count
).
to
be
1
Sidekiq
::
Testing
.
inline!
{
service
.
execute
}
expect
(
project
.
reload
.
pages_domains
.
count
).
to
be
0
end
expect
(
project
.
reload
.
pages_metadatum
.
deployed?
).
to
be
(
false
)
end
context
'with feature flag enabled
'
do
before
do
expect
(
PagesRemoveWorker
).
to
receive
(
:perform_async
).
and_call_original
end
it
'deletes all domains
'
do
expect
(
project
.
pages_domains
.
count
).
to
be
1
Sidekiq
::
Testing
.
inline!
{
service
.
execute
}
it_behaves_like
'remove pages'
expect
(
project
.
reload
.
pages_domains
.
count
).
to
be
0
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment