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
9193d18b
Commit
9193d18b
authored
Jan 19, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert most MergeRequest model specs to use `:empty_project`
parent
36cc3b92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+20
-20
No files found.
spec/models/merge_request_spec.rb
View file @
9193d18b
...
...
@@ -66,7 +66,7 @@ describe MergeRequest, models: true do
end
describe
'#target_branch_sha'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
subject
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
...
...
@@ -151,7 +151,7 @@ describe MergeRequest, models: true do
end
it
'supports a cross-project reference'
do
another_project
=
build
(
:project
,
name:
'another-project'
,
namespace:
project
.
namespace
)
another_project
=
build
(
:
empty_
project
,
name:
'another-project'
,
namespace:
project
.
namespace
)
expect
(
merge_request
.
to_reference
(
another_project
)).
to
eq
"sample-project!1"
end
...
...
@@ -246,8 +246,8 @@ describe MergeRequest, models: true do
describe
'#for_fork?'
do
it
'returns true if the merge request is for a fork'
do
subject
.
source_project
=
create
(
:
project
,
namespace:
create
(
:group
))
subject
.
target_project
=
create
(
:
project
,
namespace:
create
(
:group
))
subject
.
source_project
=
build_stubbed
(
:empty_
project
,
namespace:
create
(
:group
))
subject
.
target_project
=
build_stubbed
(
:empty_
project
,
namespace:
create
(
:group
))
expect
(
subject
.
for_fork?
).
to
be_truthy
end
...
...
@@ -696,8 +696,8 @@ describe MergeRequest, models: true do
end
describe
'#diverged_commits_count'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:fork_project
)
{
create
(
:project
,
:repository
,
forked_from_project:
project
)
}
context
'when the target branch does not exist anymore'
do
subject
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
...
...
@@ -953,7 +953,7 @@ describe MergeRequest, models: true do
end
describe
'#participants'
do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
:public
)
}
let
(
:mr
)
do
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
...
...
@@ -994,7 +994,7 @@ describe MergeRequest, models: true do
end
describe
'#check_if_can_be_merged'
do
let
(
:project
)
{
create
(
:project
,
only_allow_merge_if_build_succeeds:
true
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
only_allow_merge_if_build_succeeds:
true
)
}
subject
{
create
(
:merge_request
,
source_project:
project
,
merge_status: :unchecked
)
}
...
...
@@ -1028,7 +1028,7 @@ describe MergeRequest, models: true do
end
describe
'#mergeable?'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
subject
{
create
(
:merge_request
,
source_project:
project
)
}
...
...
@@ -1048,7 +1048,7 @@ describe MergeRequest, models: true do
end
describe
'#mergeable_state?'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
subject
{
create
(
:merge_request
,
source_project:
project
)
}
...
...
@@ -1175,7 +1175,7 @@ describe MergeRequest, models: true do
let
(
:merge_request
)
{
create
(
:merge_request_with_diff_notes
,
source_project:
project
)
}
context
'when project.only_allow_merge_if_all_discussions_are_resolved == true'
do
let
(
:project
)
{
create
(
:project
,
only_allow_merge_if_all_discussions_are_resolved:
true
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
only_allow_merge_if_all_discussions_are_resolved:
true
)
}
context
'with all discussions resolved'
do
before
do
...
...
@@ -1209,7 +1209,7 @@ describe MergeRequest, models: true do
end
context
'when project.only_allow_merge_if_all_discussions_are_resolved == false'
do
let
(
:project
)
{
create
(
:project
,
only_allow_merge_if_all_discussions_are_resolved:
false
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
only_allow_merge_if_all_discussions_are_resolved:
false
)
}
context
'with unresolved discussions'
do
before
do
...
...
@@ -1224,7 +1224,7 @@ describe MergeRequest, models: true do
end
describe
"#environments"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
)
}
context
'with multiple environments'
do
...
...
@@ -1242,7 +1242,7 @@ describe MergeRequest, models: true do
context
'with environments on source project'
do
let
(
:source_project
)
do
create
(
:project
)
do
|
fork_project
|
create
(
:project
,
:repository
)
do
|
fork_project
|
fork_project
.
create_forked_project_link
(
forked_to_project_id:
fork_project
.
id
,
forked_from_project_id:
project
.
id
)
end
end
...
...
@@ -1825,8 +1825,8 @@ describe MergeRequest, models: true do
end
describe
"#source_project_missing?"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:fork_project
)
{
create
(
:
empty_
project
,
forked_from_project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:unlink_project
)
{
Projects
::
UnlinkForkService
.
new
(
fork_project
,
user
)
}
...
...
@@ -1863,8 +1863,8 @@ describe MergeRequest, models: true do
end
describe
"#closed_without_fork?"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:fork_project
)
{
create
(
:
empty_
project
,
forked_from_project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:unlink_project
)
{
Projects
::
UnlinkForkService
.
new
(
fork_project
,
user
)
}
...
...
@@ -1909,9 +1909,9 @@ describe MergeRequest, models: true do
end
context
'forked project'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:
empty_
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:fork_project
)
{
create
(
:project
,
forked_from_project:
project
,
namespace:
user
.
namespace
)
}
let
(
:fork_project
)
{
create
(
:
empty_
project
,
forked_from_project:
project
,
namespace:
user
.
namespace
)
}
let!
(
:merge_request
)
do
create
(
:closed_merge_request
,
...
...
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