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
b9d40d25
Commit
b9d40d25
authored
Feb 06, 2013
by
Sebastian Ziebell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests added to check status codes when handling milestone via API
A few more tests added to check status code when creating or updating milestones.
parent
5be0265f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
milestones_spec.rb
spec/requests/api/milestones_spec.rb
+24
-0
No files found.
spec/requests/api/milestones_spec.rb
View file @
b9d40d25
...
...
@@ -24,6 +24,11 @@ describe Gitlab::API do
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
milestone
.
title
end
it
"should return a 404 error if milestone id not found"
do
get
api
(
"/projects/
#{
project
.
id
}
/milestones/1234"
,
user
)
response
.
status
.
should
==
404
end
end
describe
"POST /projects/:id/milestones"
do
...
...
@@ -34,6 +39,19 @@ describe Gitlab::API do
json_response
[
'title'
].
should
==
'new milestone'
json_response
[
'description'
].
should
be_nil
end
it
"should create a new project milestone with description and due date"
do
post
api
(
"/projects/
#{
project
.
id
}
/milestones"
,
user
),
title:
'new milestone'
,
description:
'release'
,
due_date:
'2013-03-02'
response
.
status
.
should
==
201
json_response
[
'description'
].
should
==
'release'
json_response
[
'due_date'
].
should
==
'2013-03-02'
end
it
"should return a 400 error if title is missing"
do
post
api
(
"/projects/
#{
project
.
id
}
/milestones"
,
user
)
response
.
status
.
should
==
400
end
end
describe
"PUT /projects/:id/milestones/:milestone_id"
do
...
...
@@ -43,5 +61,11 @@ describe Gitlab::API do
response
.
status
.
should
==
200
json_response
[
'title'
].
should
==
'updated title'
end
it
"should return a 404 error if milestone is not found"
do
put
api
(
"/projects/
#{
project
.
id
}
/milestones/1234"
,
user
),
title:
'updated title'
response
.
status
.
should
==
404
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