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
Jérome Perrin
gitlab-ce
Commits
a8ce107c
Commit
a8ce107c
authored
Aug 09, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cucumber feature -> Merge Request
parent
ac9cec74
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
92 deletions
+114
-92
features/projects/merge_requests.feature
features/projects/merge_requests.feature
+42
-0
features/step_definitions/project/project_merge_requests_steps.rb
.../step_definitions/project/project_merge_requests_steps.rb
+34
-25
features/step_definitions/project/project_milestones_steps.rb
...ures/step_definitions/project/project_milestones_steps.rb
+38
-0
spec/requests/merge_requests_spec.rb
spec/requests/merge_requests_spec.rb
+0
-67
No files found.
features/projects/merge_requests.feature
View file @
a8ce107c
Feature
:
Merge Requests
Background
:
Given
I signin as a user
And
I own project
"Shop"
And
project
"Shop"
have
"Bug NS-04"
open merge request
And
project
"Shop"
have
"Feature NS-03"
closed merge request
And
I visit project
"Shop"
merge requests page
Scenario
:
I
should see open merge requests
Then
I should see
"Bug NS-04"
in merge requests
And
I should not see
"Feature NS-03"
in merge requests
Scenario
:
I
should see closed merge requests
Given
I click link
"Closed"
Then
I should see
"Feature NS-03"
in merge requests
And
I should not see
"Bug NS-04"
in merge requests
Scenario
:
I
should see all merge requests
Given
I click link
"All"
Then
I should see
"Feature NS-03"
in merge requests
And
I should see
"Bug NS-04"
in merge requests
Scenario
:
I
visit merge request page
Given
I click link
"Bug NS-04"
Then
I should see merge request
"Bug NS-04"
Scenario
:
I
close merge request page
Given
I click link
"Bug NS-04"
And
I click link
"Close"
Then
I should see closed merge request
"Bug NS-04"
Scenario
:
I
submit new unassigned merge request
Given
I click link
"New Merge Request"
And
I submit new merge request
"Wiki Feature"
Then
I should see merge request
"Wiki Feature"
@javascript
Scenario
:
I
comment merge request
Given
I visit merge request page
"Bug NS-04"
And
I leave a comment like
"XML attached"
Then
I should see comment
"XML attached"
features/step_definitions/project/project_merge_requests_steps.rb
View file @
a8ce107c
Given
/^project "(.*?)" ha
s milestone "(.*?)"
$/
do
|
arg1
,
arg2
|
Given
/^project "(.*?)" ha
ve "(.*?)" open merge request
$/
do
|
arg1
,
arg2
|
project
=
Project
.
find_by_name
(
arg1
)
Factory
.
create
(
:merge_request
,
:title
=>
arg2
,
:project
=>
project
,
:author
=>
project
.
users
.
first
)
end
Given
/^project "(.*?)" have "(.*?)" closed merge request$/
do
|
arg1
,
arg2
|
project
=
Project
.
find_by_name
(
arg1
)
Factory
.
create
(
:merge_request
,
:title
=>
arg2
,
:project
=>
project
,
:author
=>
project
.
users
.
first
,
:closed
=>
true
)
end
milestone
=
Factory
:milestone
,
:title
=>
arg2
,
:project
=>
project
Given
/^I visit project "(.*?)" merge requests page$/
do
|
arg1
|
visit
project_merge_requests_path
(
Project
.
find_by_name
(
arg1
))
end
Then
/^I should see "(.*?)" in merge requests$/
do
|
arg1
|
page
.
should
have_content
arg1
end
3
.
times
do
|
i
|
issue
=
Factory
:issue
,
:project
=>
project
,
:milestone
=>
milestone
end
Then
/^I should not see "(.*?)" in merge requests$/
do
|
arg1
|
page
.
should_not
have_content
arg1
end
Given
/^I visit project "(.*?)" milestones page$/
do
|
arg1
|
@project
=
Project
.
find_by_name
(
arg1
)
visit
project_milestones_path
(
@project
)
Then
/^I should see merge request "(.*?)"$/
do
|
arg1
|
merge_request
=
MergeRequest
.
find_by_title
(
arg1
)
page
.
should
have_content
(
merge_request
.
title
[
0
..
10
])
page
.
should
have_content
(
merge_request
.
target_branch
)
page
.
should
have_content
(
merge_request
.
source_branch
)
end
Then
/^I should see active milestones$/
do
milestone
=
@project
.
milestones
.
first
page
.
should
have_content
(
milestone
.
title
[
0
..
10
])
page
.
should
have_content
(
milestone
.
expires_at
)
page
.
should
have_content
(
"Browse Issues"
)
Given
/^I submit new merge request "(.*?)"$/
do
|
arg1
|
fill_in
"merge_request_title"
,
:with
=>
arg1
select
"master"
,
:from
=>
"merge_request_source_branch"
select
"stable"
,
:from
=>
"merge_request_target_branch"
click_button
"Save"
end
Then
/^I should see milestone "(.*?)"$/
do
|
arg1
|
milestone
=
@project
.
milestones
.
find_by_title
(
arg1
)
page
.
should
have_content
(
milestone
.
title
[
0
..
10
])
page
.
should
have_content
(
milestone
.
expires_at
)
page
.
should
have_content
(
"Browse Issues"
)
Given
/^I visit merge request page "(.*?)"$/
do
|
arg1
|
mr
=
MergeRequest
.
find_by_title
(
arg1
)
visit
project_merge_request_path
(
mr
.
project
,
mr
)
end
Given
/^I submit new milestone "(.*?)"$/
do
|
arg1
|
fill_in
"milestone_title"
,
:with
=>
arg1
click_button
"Create milestone"
Then
/^I should see closed merge request "(.*?)"$/
do
|
arg1
|
mr
=
MergeRequest
.
find_by_title
(
arg1
)
mr
.
closed
.
should
be_true
page
.
should
have_content
"Closed by"
end
features/step_definitions/project/project_milestones_steps.rb
0 → 100644
View file @
a8ce107c
Given
/^project "(.*?)" has milestone "(.*?)"$/
do
|
arg1
,
arg2
|
project
=
Project
.
find_by_name
(
arg1
)
milestone
=
Factory
:milestone
,
:title
=>
arg2
,
:project
=>
project
3
.
times
do
|
i
|
issue
=
Factory
:issue
,
:project
=>
project
,
:milestone
=>
milestone
end
end
Given
/^I visit project "(.*?)" milestones page$/
do
|
arg1
|
@project
=
Project
.
find_by_name
(
arg1
)
visit
project_milestones_path
(
@project
)
end
Then
/^I should see active milestones$/
do
milestone
=
@project
.
milestones
.
first
page
.
should
have_content
(
milestone
.
title
[
0
..
10
])
page
.
should
have_content
(
milestone
.
expires_at
)
page
.
should
have_content
(
"Browse Issues"
)
end
Then
/^I should see milestone "(.*?)"$/
do
|
arg1
|
milestone
=
@project
.
milestones
.
find_by_title
(
arg1
)
page
.
should
have_content
(
milestone
.
title
[
0
..
10
])
page
.
should
have_content
(
milestone
.
expires_at
)
page
.
should
have_content
(
"Browse Issues"
)
end
Given
/^I submit new milestone "(.*?)"$/
do
|
arg1
|
fill_in
"milestone_title"
,
:with
=>
arg1
click_button
"Create milestone"
end
spec/requests/merge_requests_spec.rb
deleted
100644 → 0
View file @
ac9cec74
require
'spec_helper'
describe
"MergeRequests"
do
let
(
:project
)
{
Factory
:project
}
before
do
login_as
:user
project
.
add_access
(
@user
,
:read
,
:write
)
@merge_request
=
Factory
:merge_request
,
:author
=>
@user
,
:assignee
=>
@user
,
:project
=>
project
end
describe
"GET /merge_requests"
do
before
do
visit
project_merge_requests_path
(
project
)
end
subject
{
page
}
it
{
should
have_content
(
@merge_request
.
title
[
0
..
10
])
}
it
{
should
have_content
(
@merge_request
.
target_branch
)
}
it
{
should
have_content
(
@merge_request
.
source_branch
)
}
it
{
should
have_content
(
@merge_request
.
assignee
.
name
)
}
end
describe
"GET /merge_request/:id"
do
before
do
visit
project_merge_request_path
(
project
,
@merge_request
)
end
subject
{
page
}
it
{
should
have_content
(
@merge_request
.
title
[
0
..
10
])
}
it
{
should
have_content
(
@merge_request
.
target_branch
)
}
it
{
should
have_content
(
@merge_request
.
source_branch
)
}
it
{
should
have_content
(
@merge_request
.
assignee
.
name
)
}
describe
"Close merge request"
do
before
{
click_link
"Close"
}
it
{
should
have_content
(
@merge_request
.
title
[
0
..
10
])
}
it
"Show page should inform user that merge request closed"
do
page
.
should
have_content
"Closed"
end
end
end
describe
"GET /merge_requests/new"
do
before
do
visit
new_project_merge_request_path
(
project
)
fill_in
"merge_request_title"
,
:with
=>
"Merge Request Title"
select
"master"
,
:from
=>
"merge_request_source_branch"
select
"stable"
,
:from
=>
"merge_request_target_branch"
select
@user
.
name
,
:from
=>
"merge_request_assignee_id"
click_button
"Save"
end
it
{
current_path
.
should
==
project_merge_request_path
(
project
,
project
.
merge_requests
.
last
)
}
it
"should create merge request"
do
page
.
should
have_content
"Close"
page
.
should
have_content
@user
.
name
end
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