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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
639639ef
Commit
639639ef
authored
Jun 28, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for project import state transition: [:started] => [:finished]
parent
4b446bed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+34
-0
No files found.
spec/models/project_spec.rb
View file @
639639ef
...
...
@@ -1509,6 +1509,40 @@ describe Project, models: true do
end
end
describe
'project import state transitions'
do
context
'state transition: [:started] => [:finished]'
do
let
(
:housekeeping_service
)
{
spy
}
before
do
allow
(
Projects
::
HousekeepingService
).
to
receive
(
:new
)
{
housekeeping_service
}
end
it
'performs housekeeping when an import of a fresh project is completed'
do
project
=
create
(
:project_empty_repo
,
:import_started
,
import_type: :github
)
project
.
import_finish
expect
(
housekeeping_service
).
to
have_received
(
:execute
)
end
it
'does not perform housekeeping when project repository does not exist'
do
project
=
create
(
:empty_project
,
:import_started
,
import_type: :github
)
project
.
import_finish
expect
(
housekeeping_service
).
not_to
have_received
(
:execute
)
end
it
'does not perform housekeeping when project does not have a valid import type'
do
project
=
create
(
:empty_project
,
:import_started
,
import_type:
nil
)
project
.
import_finish
expect
(
housekeeping_service
).
not_to
have_received
(
:execute
)
end
end
end
describe
'#latest_successful_builds_for'
do
def
create_pipeline
(
status
=
'success'
)
create
(
:ci_pipeline
,
project:
project
,
...
...
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