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
cbe4891d
Unverified
Commit
cbe4891d
authored
Jul 31, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix form mr tests
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
2a6fc1c5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
94 deletions
+54
-94
forked_merge_requests.feature
features/project/forked_merge_requests.feature
+0
-1
forked_merge_requests.rb
features/steps/project/forked_merge_requests.rb
+10
-50
factories.rb
spec/factories.rb
+0
-43
projects.rb
spec/factories/projects.rb
+44
-0
No files found.
features/project/forked_merge_requests.feature
View file @
cbe4891d
...
...
@@ -4,7 +4,6 @@ Feature: Project Forked Merge Requests
And
I am a member of project
"Shop"
And
I have a project forked off of
"Shop"
called
"Forked Shop"
@javascript
Scenario
:
I
submit new unassigned merge request to a forked project
Given
I visit project
"Forked Shop"
merge requests page
And
I click link
"New Merge Request"
...
...
features/steps/project/forked_merge_requests.rb
View file @
cbe4891d
...
...
@@ -9,18 +9,11 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
@project
=
Project
.
find_by
(
name:
"Shop"
)
@project
||=
create
(
:project
,
name:
"Shop"
)
@project
.
team
<<
[
@user
,
:reporter
]
@project
.
ensure_satellite_exists
end
step
'I have a project forked off of "Shop" called "Forked Shop"'
do
@forking_user
=
@user
forked_project_link
=
build
(
:forked_project_link
)
@forked_project
=
Project
.
find_by
(
name:
"Forked Shop"
)
@forked_project
||=
create
(
:project
,
name:
"Forked Shop"
,
forked_project_link:
forked_project_link
,
creator_id:
@forking_user
.
id
,
namespace:
@forking_user
.
namespace
)
forked_project_link
.
forked_from_project
=
@project
forked_project_link
.
forked_to_project
=
@forked_project
@forked_project
.
team
<<
[
@forking_user
,
:master
]
forked_project_link
.
save!
@forked_project
=
Projects
::
ForkService
.
new
(
@project
,
@user
).
execute
end
step
'I click link "New Merge Request"'
do
...
...
@@ -33,8 +26,8 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
current_path
.
should
==
project_merge_request_path
(
@project
,
@merge_request
)
@merge_request
.
title
.
should
==
"Merge Request On Forked Project"
@merge_request
.
source_project
.
should
==
@forked_project
@merge_request
.
source_branch
.
should
==
"
master
"
@merge_request
.
target_branch
.
should
==
"
stable
"
@merge_request
.
source_branch
.
should
==
"
fix
"
@merge_request
.
target_branch
.
should
==
"
master
"
page
.
should
have_content
@forked_project
.
path_with_namespace
page
.
should
have_content
@project
.
path_with_namespace
page
.
should
have_content
@merge_request
.
source_branch
...
...
@@ -42,17 +35,11 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
end
step
'I fill out a "Merge Request On Forked Project" merge request'
do
select2
@forked_project
.
id
,
from:
"#merge_request_source_project_id"
select2
@project
.
id
,
from:
"#merge_request_target_project_id"
find
(
:select
,
"merge_request_source_project_id"
,
{}).
value
.
should
==
@forked_project
.
id
.
to_s
find
(
:select
,
"merge_request_target_project_id"
,
{}).
value
.
should
==
@project
.
id
.
to_s
select2
"master"
,
from:
"#merge_request_source_branch"
select2
"stable"
,
from:
"#merge_request_target_branch"
select
@forked_project
.
path_with_namespace
,
from:
"merge_request_source_project_id"
select
@project
.
path_with_namespace
,
from:
"merge_request_target_project_id"
select
"fix"
,
from:
"merge_request_source_branch"
select
"master"
,
from:
"merge_request_target_branch"
find
(
:select
,
"merge_request_source_branch"
,
{}).
value
.
should
==
'master'
find
(
:select
,
"merge_request_target_branch"
,
{}).
value
.
should
==
'stable'
click_button
"Compare branches"
fill_in
"merge_request_title"
,
with:
"Merge Request On Forked Project"
...
...
@@ -101,8 +88,8 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
@merge_request
=
@project
.
merge_requests
.
last
current_path
.
should
==
project_merge_request_path
(
@project
,
@merge_request
)
@merge_request
.
source_project
.
should
==
@forked_project
@merge_request
.
source_branch
.
should
==
"
master
"
@merge_request
.
target_branch
.
should
==
"
stable
"
@merge_request
.
source_branch
.
should
==
"
fix
"
@merge_request
.
target_branch
.
should
==
"
master
"
page
.
should
have_content
@forked_project
.
path_with_namespace
page
.
should
have_content
@project
.
path_with_namespace
page
.
should
have_content
@merge_request
.
source_branch
...
...
@@ -114,33 +101,6 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps
page
.
should
have_link
"Create Merge Request"
end
step
'project "Forked Shop" has push event'
do
@forked_project
=
Project
.
find_by
(
name:
"Forked Shop"
)
data
=
{
before:
"0000000000000000000000000000000000000000"
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/new_design"
,
user_id:
@user
.
id
,
user_name:
@user
.
name
,
repository:
{
name:
@forked_project
.
name
,
url:
"localhost/rubinius"
,
description:
""
,
homepage:
"localhost/rubinius"
,
private:
true
}
}
@event
=
Event
.
create
(
project:
@forked_project
,
action:
Event
::
PUSHED
,
data:
data
,
author_id:
@user
.
id
)
end
step
'I click link edit "Merge Request On Forked Project"'
do
find
(
"#edit_merge_request"
).
click
end
...
...
spec/factories.rb
View file @
cbe4891d
...
...
@@ -27,49 +27,6 @@ FactoryGirl.define do
factory
:admin
,
traits:
[
:admin
]
end
factory
:empty_project
,
class:
'Project'
do
sequence
(
:name
)
{
|
n
|
"project
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
namespace
creator
snippets_enabled
true
trait
:public
do
visibility_level
Gitlab
::
VisibilityLevel
::
PUBLIC
end
trait
:internal
do
visibility_level
Gitlab
::
VisibilityLevel
::
INTERNAL
end
trait
:private
do
visibility_level
Gitlab
::
VisibilityLevel
::
PRIVATE
end
end
# Generates a test repository from the repository stored under `spec/seed_project.tar.gz`.
# Once you run `rake gitlab:setup`, you can see what the repository looks like under `tmp/repositories/gitlabhq`.
# In order to modify files in the repository, you must untar the seed, modify and remake the tar.
# Before recompressing, do not forget to `git checkout master`.
# After recompressing, you need to run `RAILS_ENV=test bundle exec rake gitlab:setup` to regenerate the seeds under tmp.
#
# If you want to modify the repository only for an specific type of tests, e.g., markdown tests,
# consider using a feature branch to reduce the chances of collision with other tests.
# Create a new commit, and use the same commit message that you will use for the change in the main repo.
# Changing the commig message and SHA of branch `master` may break tests.
factory
:project
,
parent: :empty_project
do
path
{
'gitlabhq'
}
after
:create
do
|
project
|
TestEnv
.
copy_repo
(
project
)
end
end
factory
:redmine_project
,
parent: :project
do
issues_tracker
{
"redmine"
}
issues_tracker_id
{
"project_name_in_redmine"
}
end
factory
:group
do
sequence
(
:name
)
{
|
n
|
"group
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
...
...
spec/factories/projects.rb
0 → 100644
View file @
cbe4891d
FactoryGirl
.
define
do
factory
:empty_project
,
class:
'Project'
do
sequence
(
:name
)
{
|
n
|
"project
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
namespace
creator
snippets_enabled
true
trait
:public
do
visibility_level
Gitlab
::
VisibilityLevel
::
PUBLIC
end
trait
:internal
do
visibility_level
Gitlab
::
VisibilityLevel
::
INTERNAL
end
trait
:private
do
visibility_level
Gitlab
::
VisibilityLevel
::
PRIVATE
end
end
# Generates a test repository from the repository stored under `spec/seed_project.tar.gz`.
# Once you run `rake gitlab:setup`, you can see what the repository looks like under `tmp/repositories/gitlabhq`.
# In order to modify files in the repository, you must untar the seed, modify and remake the tar.
# Before recompressing, do not forget to `git checkout master`.
# After recompressing, you need to run `RAILS_ENV=test bundle exec rake gitlab:setup` to regenerate the seeds under tmp.
#
# If you want to modify the repository only for an specific type of tests, e.g., markdown tests,
# consider using a feature branch to reduce the chances of collision with other tests.
# Create a new commit, and use the same commit message that you will use for the change in the main repo.
# Changing the commig message and SHA of branch `master` may break tests.
factory
:project
,
parent: :empty_project
do
path
{
'gitlabhq'
}
after
:create
do
|
project
|
TestEnv
.
copy_repo
(
project
)
end
end
factory
:redmine_project
,
parent: :project
do
issues_tracker
{
"redmine"
}
issues_tracker_id
{
"project_name_in_redmine"
}
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