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
Boxiang Sun
gitlab-ce
Commits
3ed66d4a
Commit
3ed66d4a
authored
Jun 05, 2018
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds #human_import_status_name to make it comply with ProjectImportState#human_status_name
parent
7e54d046
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
app/models/project.rb
app/models/project.rb
+6
-0
changelogs/unreleased/47208-human-import-status-name-not-working.yml
...unreleased/47208-human-import-status-name-not-working.yml
+5
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+25
-0
No files found.
app/models/project.rb
View file @
3ed66d4a
...
@@ -674,6 +674,12 @@ class Project < ActiveRecord::Base
...
@@ -674,6 +674,12 @@ class Project < ActiveRecord::Base
end
end
end
end
def
human_import_status_name
ensure_import_state
import_state
.
human_status_name
end
def
import_schedule
def
import_schedule
ensure_import_state
(
force:
true
)
ensure_import_state
(
force:
true
)
...
...
changelogs/unreleased/47208-human-import-status-name-not-working.yml
0 → 100644
View file @
3ed66d4a
---
title
:
Showing project import_status in a humanized form no longer gives an error
merge_request
:
19470
author
:
type
:
fixed
spec/models/project_spec.rb
View file @
3ed66d4a
...
@@ -1693,6 +1693,31 @@ describe Project do
...
@@ -1693,6 +1693,31 @@ describe Project do
end
end
end
end
describe
'#human_import_status_name'
do
context
'when import_state exists'
do
it
'returns the humanized status name'
do
project
=
create
(
:project
)
create
(
:import_state
,
:started
,
project:
project
)
expect
(
project
.
human_import_status_name
).
to
eq
(
"started"
)
end
end
context
'when import_state was not created yet'
do
let
(
:project
)
{
create
(
:project
,
:import_started
)
}
it
'ensures import_state is created and returns humanized status name'
do
expect
do
project
.
human_import_status_name
end
.
to
change
{
ProjectImportState
.
count
}.
from
(
0
).
to
(
1
)
end
it
'returns humanized status name'
do
expect
(
project
.
human_import_status_name
).
to
eq
(
"started"
)
end
end
end
describe
'Project import job'
do
describe
'Project import job'
do
let
(
:project
)
{
create
(
:project
,
import_url:
generate
(
:url
))
}
let
(
:project
)
{
create
(
:project
,
import_url:
generate
(
:url
))
}
...
...
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