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
0e85ce11
Commit
0e85ce11
authored
Dec 06, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move ee-specific codeclimate tests from ce spec to ee spec
parent
3b612fe2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
44 deletions
+44
-44
spec/ee/spec/models/ee/merge_request_spec.rb
spec/ee/spec/models/ee/merge_request_spec.rb
+44
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+0
-44
No files found.
spec/ee/spec/models/ee/merge_request_spec.rb
View file @
0e85ce11
...
...
@@ -167,6 +167,50 @@ describe MergeRequest do
end
end
describe
'#base_pipeline'
do
let!
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
subject
.
project
,
sha:
subject
.
diff_base_sha
)
}
it
{
expect
(
subject
.
base_pipeline
).
to
eq
(
pipeline
)
}
end
describe
'#base_codeclimate_artifact'
do
before
do
allow
(
subject
.
base_pipeline
).
to
receive
(
:codeclimate_artifact
)
.
and_return
(
1
)
end
it
'delegates to merge request diff'
do
expect
(
subject
.
base_codeclimate_artifact
).
to
eq
(
1
)
end
end
describe
'#head_codeclimate_artifact'
do
before
do
allow
(
subject
.
head_pipeline
).
to
receive
(
:codeclimate_artifact
)
.
and_return
(
1
)
end
it
'delegates to merge request diff'
do
expect
(
subject
.
head_codeclimate_artifact
).
to
eq
(
1
)
end
end
describe
'#has_codeclimate_data?'
do
context
'with codeclimate artifact'
do
before
do
artifact
=
double
(
success?:
true
)
allow
(
subject
.
head_pipeline
).
to
receive
(
:codeclimate_artifact
).
and_return
(
artifact
)
allow
(
subject
.
base_pipeline
).
to
receive
(
:codeclimate_artifact
).
and_return
(
artifact
)
end
it
{
expect
(
subject
.
has_codeclimate_data?
).
to
be_truthy
}
end
context
'without codeclimate artifact'
do
it
{
expect
(
subject
.
has_codeclimate_data?
).
to
be_falsey
}
end
end
describe
'#sast_artifact'
do
it
{
is_expected
.
to
delegate_method
(
:sast_artifact
).
to
(
:head_pipeline
)
}
end
...
...
spec/models/merge_request_spec.rb
View file @
0e85ce11
...
...
@@ -2250,50 +2250,6 @@ describe MergeRequest do
end
end
describe
'#base_pipeline'
do
let!
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
subject
.
project
,
sha:
subject
.
diff_base_sha
)
}
it
{
expect
(
subject
.
base_pipeline
).
to
eq
(
pipeline
)
}
end
describe
'#base_codeclimate_artifact'
do
before
do
allow
(
subject
.
base_pipeline
).
to
receive
(
:codeclimate_artifact
)
.
and_return
(
1
)
end
it
'delegates to merge request diff'
do
expect
(
subject
.
base_codeclimate_artifact
).
to
eq
(
1
)
end
end
describe
'#head_codeclimate_artifact'
do
before
do
allow
(
subject
.
head_pipeline
).
to
receive
(
:codeclimate_artifact
)
.
and_return
(
1
)
end
it
'delegates to merge request diff'
do
expect
(
subject
.
head_codeclimate_artifact
).
to
eq
(
1
)
end
end
describe
'#has_codeclimate_data?'
do
context
'with codeclimate artifact'
do
before
do
artifact
=
double
(
success?:
true
)
allow
(
subject
.
head_pipeline
).
to
receive
(
:codeclimate_artifact
).
and_return
(
artifact
)
allow
(
subject
.
base_pipeline
).
to
receive
(
:codeclimate_artifact
).
and_return
(
artifact
)
end
it
{
expect
(
subject
.
has_codeclimate_data?
).
to
be_truthy
}
end
context
'without codeclimate artifact'
do
it
{
expect
(
subject
.
has_codeclimate_data?
).
to
be_falsey
}
end
end
describe
'#fetch_ref!'
do
it
'fetches the ref correctly'
do
expect
{
subject
.
target_project
.
repository
.
delete_refs
(
subject
.
ref_path
)
}.
not_to
raise_error
...
...
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