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
0fd0000b
Commit
0fd0000b
authored
Jan 14, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for CI builds and pipeline relationships
parent
8ddb00ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+7
-0
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+7
-0
No files found.
spec/models/ci/build_spec.rb
View file @
0fd0000b
...
...
@@ -25,6 +25,13 @@ describe Ci::Build do
it
{
is_expected
.
to
be_a
(
ArtifactMigratable
)
}
describe
'associations'
do
it
'has a bidirectional relationship with projects'
do
expect
(
described_class
.
reflect_on_association
(
:project
).
has_inverse?
).
to
eq
(
:builds
)
expect
(
Project
.
reflect_on_association
(
:builds
).
has_inverse?
).
to
eq
(
:project
)
end
end
describe
'callbacks'
do
context
'when running after_create callback'
do
it
'triggers asynchronous build hooks worker'
do
...
...
spec/models/ci/pipeline_spec.rb
View file @
0fd0000b
...
...
@@ -28,6 +28,13 @@ describe Ci::Pipeline, :mailer do
it
{
is_expected
.
to
respond_to
:short_sha
}
it
{
is_expected
.
to
delegate_method
(
:full_path
).
to
(
:project
).
with_prefix
}
describe
'associations'
do
it
'has a bidirectional relationship with projects'
do
expect
(
described_class
.
reflect_on_association
(
:project
).
has_inverse?
).
to
eq
(
:pipelines
)
expect
(
Project
.
reflect_on_association
(
:pipelines
).
has_inverse?
).
to
eq
(
:project
)
end
end
describe
'#source'
do
context
'when creating new pipeline'
do
let
(
:pipeline
)
do
...
...
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