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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
56bf829c
Commit
56bf829c
authored
Oct 25, 2012
by
Valeriy Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: fix after review
parent
e6cdfb60
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+6
-6
No files found.
spec/requests/api/merge_requests_spec.rb
View file @
56bf829c
...
@@ -11,14 +11,14 @@ describe Gitlab::API do
...
@@ -11,14 +11,14 @@ describe Gitlab::API do
describe
"GET /projects/:id/merge_requests"
do
describe
"GET /projects/:id/merge_requests"
do
context
"when unauthenticated"
do
context
"when unauthenticated"
do
it
"should return authentication error"
do
it
"should return authentication error"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
)
get
api
(
"/projects/
#{
project
.
code
}
/merge_requests"
)
response
.
status
.
should
==
401
response
.
status
.
should
==
401
end
end
end
end
context
"when authenticated"
do
context
"when authenticated"
do
it
"should return an array of merge_requests"
do
it
"should return an array of merge_requests"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
)
get
api
(
"/projects/
#{
project
.
code
}
/merge_requests"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
should
be_an
Array
json_response
.
first
[
'title'
].
should
==
merge_request
.
title
json_response
.
first
[
'title'
].
should
==
merge_request
.
title
...
@@ -28,7 +28,7 @@ describe Gitlab::API do
...
@@ -28,7 +28,7 @@ describe Gitlab::API do
describe
"GET /projects/:id/merge_request/:merge_request_id"
do
describe
"GET /projects/:id/merge_request/:merge_request_id"
do
it
"should return merge_request"
do
it
"should return merge_request"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
code
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
)
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
merge_request
.
title
json_response
[
'title'
].
should
==
merge_request
.
title
end
end
...
@@ -36,7 +36,7 @@ describe Gitlab::API do
...
@@ -36,7 +36,7 @@ describe Gitlab::API do
describe
"POST /projects/:id/merge_requests"
do
describe
"POST /projects/:id/merge_requests"
do
it
"should return merge_request"
do
it
"should return merge_request"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests"
,
user
),
post
api
(
"/projects/
#{
project
.
code
}
/merge_requests"
,
user
),
title:
'Test merge_request'
,
source_branch:
"stable"
,
target_branch:
"master"
,
author:
user
title:
'Test merge_request'
,
source_branch:
"stable"
,
target_branch:
"master"
,
author:
user
response
.
status
.
should
==
201
response
.
status
.
should
==
201
json_response
[
'title'
].
should
==
'Test merge_request'
json_response
[
'title'
].
should
==
'Test merge_request'
...
@@ -45,7 +45,7 @@ describe Gitlab::API do
...
@@ -45,7 +45,7 @@ describe Gitlab::API do
describe
"PUT /projects/:id/merge_request/:merge_request_id"
do
describe
"PUT /projects/:id/merge_request/:merge_request_id"
do
it
"should return merge_request"
do
it
"should return merge_request"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
title:
"New title"
put
api
(
"/projects/
#{
project
.
code
}
/merge_request/
#{
merge_request
.
id
}
"
,
user
),
title:
"New title"
response
.
status
.
should
==
200
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
'New title'
json_response
[
'title'
].
should
==
'New title'
end
end
...
@@ -53,7 +53,7 @@ describe Gitlab::API do
...
@@ -53,7 +53,7 @@ describe Gitlab::API do
describe
"POST /projects/:id/merge_request/:merge_request_id/comments"
do
describe
"POST /projects/:id/merge_request/:merge_request_id/comments"
do
it
"should return comment"
do
it
"should return comment"
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_request/
#{
merge_request
.
id
}
/comments"
,
user
),
note:
"My comment"
post
api
(
"/projects/
#{
project
.
code
}
/merge_request/
#{
merge_request
.
id
}
/comments"
,
user
),
note:
"My comment"
response
.
status
.
should
==
201
response
.
status
.
should
==
201
json_response
[
'note'
].
should
==
'My comment'
json_response
[
'note'
].
should
==
'My comment'
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