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
Kazuhiko Shiozaki
gitlab-ce
Commits
8ff171f6
Commit
8ff171f6
authored
Jun 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix api specs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
e8f222e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
spec/requests/api/notes_spec.rb
spec/requests/api/notes_spec.rb
+2
-2
spec/requests/api/project_members_spec.rb
spec/requests/api/project_members_spec.rb
+6
-6
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+3
-3
No files found.
spec/requests/api/notes_spec.rb
View file @
8ff171f6
...
...
@@ -93,7 +93,7 @@ describe API::API, api: true do
post
api
(
"/projects/
#{
project
.
id
}
/issues/
#{
issue
.
id
}
/notes"
,
user
),
body:
'hi!'
response
.
status
.
should
==
201
json_response
[
'body'
].
should
==
'hi!'
json_response
[
'author'
][
'
email'
].
should
==
user
.
email
json_response
[
'author'
][
'
username'
].
should
==
user
.
username
end
it
"should return a 400 bad request error if body not given"
do
...
...
@@ -112,7 +112,7 @@ describe API::API, api: true do
post
api
(
"/projects/
#{
project
.
id
}
/snippets/
#{
snippet
.
id
}
/notes"
,
user
),
body:
'hi!'
response
.
status
.
should
==
201
json_response
[
'body'
].
should
==
'hi!'
json_response
[
'author'
][
'
email'
].
should
==
user
.
email
json_response
[
'author'
][
'
username'
].
should
==
user
.
username
end
it
"should return a 400 bad request error if body not given"
do
...
...
spec/requests/api/project_members_spec.rb
View file @
8ff171f6
...
...
@@ -21,7 +21,7 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
count
.
should
==
2
json_response
.
map
{
|
u
|
u
[
'
email'
]
}.
should
include
user
.
email
json_response
.
map
{
|
u
|
u
[
'
username'
]
}.
should
include
user
.
username
end
it
"finds team members with query string"
do
...
...
@@ -29,7 +29,7 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
count
.
should
==
1
json_response
.
first
[
'
email'
].
should
==
user
.
email
json_response
.
first
[
'
username'
].
should
==
user
.
username
end
it
"should return a 404 error if id not found"
do
...
...
@@ -44,7 +44,7 @@ describe API::API, api: true do
it
"should return project team member"
do
get
api
(
"/projects/
#{
project
.
id
}
/members/
#{
user
.
id
}
"
,
user
)
response
.
status
.
should
==
200
json_response
[
'
email'
].
should
==
user
.
email
json_response
[
'
username'
].
should
==
user
.
username
json_response
[
'access_level'
].
should
==
UsersProject
::
MASTER
end
...
...
@@ -62,7 +62,7 @@ describe API::API, api: true do
}.
to
change
{
UsersProject
.
count
}.
by
(
1
)
response
.
status
.
should
==
201
json_response
[
'
email'
].
should
==
user2
.
email
json_response
[
'
username'
].
should
==
user2
.
username
json_response
[
'access_level'
].
should
==
UsersProject
::
DEVELOPER
end
...
...
@@ -75,7 +75,7 @@ describe API::API, api: true do
}.
not_to
change
{
UsersProject
.
count
}.
by
(
1
)
response
.
status
.
should
==
201
json_response
[
'
email'
].
should
==
user2
.
email
json_response
[
'
username'
].
should
==
user2
.
username
json_response
[
'access_level'
].
should
==
UsersProject
::
DEVELOPER
end
...
...
@@ -101,7 +101,7 @@ describe API::API, api: true do
it
"should update project team member"
do
put
api
(
"/projects/
#{
project
.
id
}
/members/
#{
user3
.
id
}
"
,
user
),
access_level:
UsersProject
::
MASTER
response
.
status
.
should
==
200
json_response
[
'
email'
].
should
==
user3
.
email
json_response
[
'
username'
].
should
==
user3
.
username
json_response
[
'access_level'
].
should
==
UsersProject
::
MASTER
end
...
...
spec/requests/api/projects_spec.rb
View file @
8ff171f6
...
...
@@ -37,7 +37,7 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
first
[
'name'
].
should
==
project
.
name
json_response
.
first
[
'owner'
][
'
email'
].
should
==
user
.
email
json_response
.
first
[
'owner'
][
'
username'
].
should
==
user
.
username
end
end
end
...
...
@@ -65,7 +65,7 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
first
[
'name'
].
should
==
project
.
name
json_response
.
first
[
'owner'
][
'
email'
].
should
==
user
.
email
json_response
.
first
[
'owner'
][
'
username'
].
should
==
user
.
username
end
end
end
...
...
@@ -270,7 +270,7 @@ describe API::API, api: true do
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
response
.
status
.
should
==
200
json_response
[
'name'
].
should
==
project
.
name
json_response
[
'owner'
][
'
email'
].
should
==
user
.
email
json_response
[
'owner'
][
'
username'
].
should
==
user
.
username
end
it
"should return a project by path name"
do
...
...
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