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
6bf1780a
Commit
6bf1780a
authored
Apr 06, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for relations and scopes, and setting
parent
016e1a29
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
spec/features/projects/settings/pipelines_settings_spec.rb
spec/features/projects/settings/pipelines_settings_spec.rb
+11
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+2
-0
spec/models/concerns/has_status_spec.rb
spec/models/concerns/has_status_spec.rb
+12
-0
No files found.
spec/features/projects/settings/pipelines_settings_spec.rb
View file @
6bf1780a
...
...
@@ -32,5 +32,16 @@ feature "Pipelines settings", feature: true do
expect
(
page
).
to
have_button
(
'Save changes'
,
disabled:
false
)
expect
(
page
).
to
have_field
(
'Test coverage parsing'
,
with:
'coverage_regex'
)
end
scenario
'updates auto_cancel_pending_pipelines'
do
page
.
check
(
'Auto-cancel redundant, pending pipelines'
)
click_on
'Save changes'
expect
(
page
.
status_code
).
to
eq
(
200
)
expect
(
page
).
to
have_button
(
'Save changes'
,
disabled:
false
)
checkbox
=
find_field
(
'project_auto_cancel_pending_pipelines'
)
expect
(
checkbox
).
to
be_checked
end
end
end
spec/models/ci/pipeline_spec.rb
View file @
6bf1780a
...
...
@@ -12,10 +12,12 @@ describe Ci::Pipeline, models: true do
it
{
is_expected
.
to
belong_to
(
:project
)
}
it
{
is_expected
.
to
belong_to
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:auto_canceled_by
)
}
it
{
is_expected
.
to
have_many
(
:statuses
)
}
it
{
is_expected
.
to
have_many
(
:trigger_requests
)
}
it
{
is_expected
.
to
have_many
(
:builds
)
}
it
{
is_expected
.
to
have_many
(
:auto_canceled_pipelines
)
}
it
{
is_expected
.
to
validate_presence_of
:sha
}
it
{
is_expected
.
to
validate_presence_of
:status
}
...
...
spec/models/concerns/has_status_spec.rb
View file @
6bf1780a
...
...
@@ -231,6 +231,18 @@ describe HasStatus do
end
end
describe
'.created_or_pending'
do
subject
{
CommitStatus
.
created_or_pending
}
%i[created pending]
.
each
do
|
status
|
it_behaves_like
'containing the job'
,
status
end
%i[running failed success]
.
each
do
|
status
|
it_behaves_like
'not containing the job'
,
status
end
end
describe
'.finished'
do
subject
{
CommitStatus
.
finished
}
...
...
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