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
60c6649a
Commit
60c6649a
authored
Nov 28, 2011
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for merge request index/show
parent
6b941cf9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
4 deletions
+59
-4
spec/factories.rb
spec/factories.rb
+6
-0
spec/requests/merge_requests_spec.rb
spec/requests/merge_requests_spec.rb
+44
-4
spec/requests/projects_security_spec.rb
spec/requests/projects_security_spec.rb
+9
-0
No files found.
spec/factories.rb
View file @
60c6649a
...
...
@@ -34,6 +34,12 @@ Factory.add(:issue, Issue) do |obj|
obj
.
title
=
Faker
::
Lorem
.
sentence
end
Factory
.
add
(
:merge_request
,
MergeRequest
)
do
|
obj
|
obj
.
title
=
Faker
::
Lorem
.
sentence
obj
.
source_branch
=
"master"
obj
.
target_branch
=
"master"
end
Factory
.
add
(
:snippet
,
Snippet
)
do
|
obj
|
obj
.
title
=
Faker
::
Lorem
.
sentence
obj
.
file_name
=
Faker
::
Lorem
.
sentence
...
...
spec/requests/merge_requests_spec.rb
View file @
60c6649a
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
it
"works! (now write some real specs)"
do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get
merge_requests_path
response
.
status
.
should
be
(
200
)
before
do
visit
project_merge_requests_path
(
project
)
end
subject
{
page
}
it
{
should
have_content
(
@merge_request
.
title
)
}
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
)
}
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
)
}
it
"Show page should inform user that merge request closed"
do
within
".merge-request-show-holder h3"
do
page
.
should
have_content
"Closed"
end
end
end
end
end
spec/requests/projects_security_spec.rb
View file @
60c6649a
...
...
@@ -122,5 +122,14 @@ describe "Projects" do
it
{
project_snippets_path
(
@project
).
should
be_denied_for
:user
}
it
{
project_snippets_path
(
@project
).
should
be_denied_for
:visitor
}
end
describe
"GET /project_code/merge_requests"
do
it
{
project_merge_requests_path
(
@project
).
should
be_allowed_for
@u1
}
it
{
project_merge_requests_path
(
@project
).
should
be_allowed_for
@u3
}
it
{
project_merge_requests_path
(
@project
).
should
be_denied_for
:admin
}
it
{
project_merge_requests_path
(
@project
).
should
be_denied_for
@u2
}
it
{
project_merge_requests_path
(
@project
).
should
be_denied_for
:user
}
it
{
project_merge_requests_path
(
@project
).
should
be_denied_for
:visitor
}
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