BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
37b45031
Commit
37b45031
authored
Jan 26, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-empty_project-for-associations' into 'master'
Factories with a project association use `:empty_project` by default See merge request !8770
parents
3a0d9314
c1743ba4
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
30 additions
and
23 deletions
+30
-23
revert.rb
features/steps/project/merge_requests/revert.rb
+3
-4
deploy_keys_projects.rb
spec/factories/deploy_keys_projects.rb
+1
-1
events.rb
spec/factories/events.rb
+1
-1
file_uploader.rb
spec/factories/file_uploader.rb
+1
-1
issues.rb
spec/factories/issues.rb
+1
-1
labels.rb
spec/factories/labels.rb
+1
-1
merge_requests.rb
spec/factories/merge_requests.rb
+1
-1
milestones.rb
spec/factories/milestones.rb
+1
-1
notes.rb
spec/factories/notes.rb
+11
-3
project_group_links.rb
spec/factories/project_group_links.rb
+1
-1
project_members.rb
spec/factories/project_members.rb
+1
-1
project_snippets.rb
spec/factories/project_snippets.rb
+1
-1
releases.rb
spec/factories/releases.rb
+1
-1
sent_notifications.rb
spec/factories/sent_notifications.rb
+1
-1
services.rb
spec/factories/services.rb
+1
-1
todos.rb
spec/factories/todos.rb
+1
-1
issue_spec.rb
spec/models/issue_spec.rb
+1
-1
note_spec.rb
spec/models/note_spec.rb
+1
-1
No files found.
features/steps/project/merge_requests/revert.rb
View file @
37b45031
...
...
@@ -30,14 +30,13 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps
end
step
'I am signed in as a developer of the project'
do
@user
=
create
(
:user
)
{
|
u
|
@project
.
add_developer
(
u
)
}
login_as
(
@user
)
end
step
'There is an open Merge Request'
do
@user
=
create
(
:user
)
@project
=
create
(
:project
,
:public
,
:repository
)
@project_member
=
create
(
:project_member
,
:developer
,
user:
@user
,
project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
,
source_project:
@project
)
@merge_request
=
create
(
:merge_request
,
:with_diffs
,
:simple
)
@project
=
@merge_request
.
source_project
end
step
'I should see a revert error'
do
...
...
spec/factories/deploy_keys_projects.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:deploy_keys_project
do
deploy_key
project
project
factory: :empty_project
end
end
spec/factories/events.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:event
do
project
project
factory: :empty_project
author
factory: :user
factory
:closed_issue_event
do
...
...
spec/factories/file_uploader.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:file_uploader
do
project
project
factory: :empty_project
secret
nil
transient
do
...
...
spec/factories/issues.rb
View file @
37b45031
...
...
@@ -6,7 +6,7 @@ FactoryGirl.define do
factory
:issue
do
title
author
project
project
factory: :empty_project
trait
:confidential
do
confidential
true
...
...
spec/factories/labels.rb
View file @
37b45031
...
...
@@ -2,7 +2,7 @@ FactoryGirl.define do
factory
:label
,
class:
ProjectLabel
do
sequence
(
:title
)
{
|
n
|
"label
#{
n
}
"
}
color
"#990000"
project
project
factory: :empty_project
transient
do
priority
nil
...
...
spec/factories/merge_requests.rb
View file @
37b45031
...
...
@@ -2,7 +2,7 @@ FactoryGirl.define do
factory
:merge_request
do
title
author
source_project
factory: :project
association
:source_project
,
:repository
,
factory: :project
target_project
{
source_project
}
# $ git log --pretty=oneline feature..master
...
...
spec/factories/milestones.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:milestone
do
title
project
project
factory: :empty_project
trait
:active
do
state
"active"
...
...
spec/factories/notes.rb
View file @
37b45031
...
...
@@ -4,7 +4,7 @@ include ActionDispatch::TestProcess
FactoryGirl
.
define
do
factory
:note
do
project
project
factory: :empty_project
note
"Note"
author
on_issue
...
...
@@ -16,10 +16,16 @@ FactoryGirl.define do
factory
:note_on_personal_snippet
,
traits:
[
:on_personal_snippet
]
factory
:system_note
,
traits:
[
:system
]
factory
:legacy_diff_note_on_commit
,
traits:
[
:on_commit
,
:legacy_diff_note
],
class:
LegacyDiffNote
factory
:legacy_diff_note_on_merge_request
,
traits:
[
:on_merge_request
,
:legacy_diff_note
],
class:
LegacyDiffNote
factory
:legacy_diff_note_on_commit
,
traits:
[
:on_commit
,
:legacy_diff_note
],
class:
LegacyDiffNote
do
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
association
:project
,
:repository
position
do
Gitlab
::
Diff
::
Position
.
new
(
old_path:
"files/ruby/popen.rb"
,
...
...
@@ -37,6 +43,7 @@ FactoryGirl.define do
end
factory
:diff_note_on_commit
,
traits:
[
:on_commit
],
class:
DiffNote
do
association
:project
,
:repository
position
do
Gitlab
::
Diff
::
Position
.
new
(
old_path:
"files/ruby/popen.rb"
,
...
...
@@ -49,6 +56,7 @@ FactoryGirl.define do
end
trait
:on_commit
do
association
:project
,
:repository
noteable
nil
noteable_type
'Commit'
noteable_id
nil
...
...
spec/factories/project_group_links.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:project_group_link
do
project
project
factory: :empty_project
group
end
end
spec/factories/project_members.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:project_member
do
user
project
project
factory: :empty_project
master
trait
(
:guest
)
{
access_level
ProjectMember
::
GUEST
}
...
...
spec/factories/project_snippets.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:project_snippet
,
parent: :snippet
,
class: :ProjectSnippet
do
project
project
factory: :empty_project
end
end
spec/factories/releases.rb
View file @
37b45031
...
...
@@ -2,6 +2,6 @@ FactoryGirl.define do
factory
:release
do
tag
"v1.1.0"
description
"Awesome release"
project
project
factory: :empty_project
end
end
spec/factories/sent_notifications.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:sent_notification
do
project
project
factory: :empty_project
recipient
factory: :user
noteable
factory: :issue
reply_key
"0123456789abcdef"
*
2
...
...
spec/factories/services.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:service
do
project
project
factory: :empty_project
end
end
spec/factories/todos.rb
View file @
37b45031
FactoryGirl
.
define
do
factory
:todo
do
project
project
factory: :empty_project
author
user
target
factory: :issue
...
...
spec/models/issue_spec.rb
View file @
37b45031
...
...
@@ -217,7 +217,7 @@ describe Issue, models: true do
end
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
(
:set_mentionable_text
)
{
->
(
txt
){
subject
.
description
=
txt
}
}
...
...
spec/models/note_spec.rb
View file @
37b45031
...
...
@@ -138,7 +138,7 @@ describe Note, models: true do
it_behaves_like
'an editable mentionable'
do
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
(
:set_mentionable_text
)
{
->
(
txt
)
{
subject
.
note
=
txt
}
}
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