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
Tatuya Kamada
gitlab-ce
Commits
c1743ba4
Commit
c1743ba4
authored
Jan 25, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a project factory with a repository where necessary
parent
d0315d53
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
9 deletions
+15
-9
features/steps/project/merge_requests/revert.rb
features/steps/project/merge_requests/revert.rb
+3
-4
spec/factories/merge_requests.rb
spec/factories/merge_requests.rb
+1
-1
spec/factories/notes.rb
spec/factories/notes.rb
+9
-2
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+1
-1
spec/models/note_spec.rb
spec/models/note_spec.rb
+1
-1
No files found.
features/steps/project/merge_requests/revert.rb
View file @
c1743ba4
...
@@ -30,14 +30,13 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
...
@@ -30,14 +30,13 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
end
end
step
'I am signed in as a developer of the project'
do
step
'I am signed in as a developer of the project'
do
@user
=
create
(
:user
)
{
|
u
|
@project
.
add_developer
(
u
)
}
login_as
(
@user
)
login_as
(
@user
)
end
end
step
'There is an open Merge Request'
do
step
'There is an open Merge Request'
do
@user
=
create
(
:user
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
)
@project
=
create
(
:project
,
:public
,
:repository
)
@project
=
@merge_request
.
source_project
@project_member
=
create
(
:project_member
,
:developer
,
user:
@user
,
project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
@project
)
end
end
step
'I should see a revert error'
do
step
'I should see a revert error'
do
...
...
spec/factories/merge_requests.rb
View file @
c1743ba4
...
@@ -2,7 +2,7 @@ FactoryGirl.define do
...
@@ -2,7 +2,7 @@ FactoryGirl.define do
factory
:merge_request
do
factory
:merge_request
do
title
title
author
author
source_project
factory: :project
association
:source_project
,
:repository
,
factory: :project
target_project
{
source_project
}
target_project
{
source_project
}
# $ git log --pretty=oneline feature..master
# $ git log --pretty=oneline feature..master
...
...
spec/factories/notes.rb
View file @
c1743ba4
...
@@ -15,10 +15,16 @@ FactoryGirl.define do
...
@@ -15,10 +15,16 @@ FactoryGirl.define do
factory
:note_on_project_snippet
,
traits:
[
:on_project_snippet
]
factory
:note_on_project_snippet
,
traits:
[
:on_project_snippet
]
factory
:system_note
,
traits:
[
:system
]
factory
:system_note
,
traits:
[
:system
]
factory
:legacy_diff_note_on_commit
,
traits:
[
:on_commit
,
:legacy_diff_note
],
class:
LegacyDiffNote
factory
:legacy_diff_note_on_commit
,
traits:
[
:on_commit
,
:legacy_diff_note
],
class:
LegacyDiffNote
do
factory
:legacy_diff_note_on_merge_request
,
traits:
[
:on_merge_request
,
:legacy_diff_note
],
class:
LegacyDiffNote
association
:project
,
:repository
end
factory
:legacy_diff_note_on_merge_request
,
traits:
[
:on_merge_request
,
:legacy_diff_note
],
class:
LegacyDiffNote
do
association
:project
,
:repository
end
factory
:diff_note_on_merge_request
,
traits:
[
:on_merge_request
],
class:
DiffNote
do
factory
:diff_note_on_merge_request
,
traits:
[
:on_merge_request
],
class:
DiffNote
do
association
:project
,
:repository
position
do
position
do
Gitlab
::
Diff
::
Position
.
new
(
Gitlab
::
Diff
::
Position
.
new
(
old_path:
"files/ruby/popen.rb"
,
old_path:
"files/ruby/popen.rb"
,
...
@@ -49,6 +55,7 @@ FactoryGirl.define do
...
@@ -49,6 +55,7 @@ FactoryGirl.define do
end
end
trait
:on_commit
do
trait
:on_commit
do
association
:project
,
:repository
noteable
nil
noteable
nil
noteable_type
'Commit'
noteable_type
'Commit'
noteable_id
nil
noteable_id
nil
...
...
spec/models/issue_spec.rb
View file @
c1743ba4
...
@@ -217,7 +217,7 @@ describe Issue, models: true do
...
@@ -217,7 +217,7 @@ describe Issue, models: true do
end
end
it_behaves_like
'an editable mentionable'
do
it_behaves_like
'an editable mentionable'
do
subject
{
create
(
:issue
)
}
subject
{
create
(
:issue
,
project:
create
(
:project
,
:repository
)
)
}
let
(
:backref_text
)
{
"issue
#{
subject
.
to_reference
}
"
}
let
(
:backref_text
)
{
"issue
#{
subject
.
to_reference
}
"
}
let
(
:set_mentionable_text
)
{
->
(
txt
){
subject
.
description
=
txt
}
}
let
(
:set_mentionable_text
)
{
->
(
txt
){
subject
.
description
=
txt
}
}
...
...
spec/models/note_spec.rb
View file @
c1743ba4
...
@@ -125,7 +125,7 @@ describe Note, models: true do
...
@@ -125,7 +125,7 @@ describe Note, models: true do
it_behaves_like
'an editable mentionable'
do
it_behaves_like
'an editable mentionable'
do
subject
{
create
:note
,
noteable:
issue
,
project:
issue
.
project
}
subject
{
create
:note
,
noteable:
issue
,
project:
issue
.
project
}
let
(
:issue
)
{
create
:issue
}
let
(
:issue
)
{
create
(
:issue
,
project:
create
(
:project
,
:repository
))
}
let
(
:backref_text
)
{
issue
.
gfm_reference
}
let
(
:backref_text
)
{
issue
.
gfm_reference
}
let
(
:set_mentionable_text
)
{
->
(
txt
)
{
subject
.
note
=
txt
}
}
let
(
:set_mentionable_text
)
{
->
(
txt
)
{
subject
.
note
=
txt
}
}
end
end
...
...
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