Commit 86d5a63e authored by Marin Jankovski's avatar Marin Jankovski

Fix failing api specs.

parent ff435000
...@@ -20,8 +20,7 @@ describe API::API, api: true do ...@@ -20,8 +20,7 @@ describe API::API, api: true do
response.status.should == 200 response.status.should == 200
json_response.should be_an Array json_response.should be_an Array
# Admin namespace + 2 group namespaces json_response.length.should == Namespace.count
json_response.length.should == 3
end end
end end
end end
......
...@@ -54,8 +54,15 @@ describe API::API, api: true do ...@@ -54,8 +54,15 @@ describe API::API, api: true do
get api("/projects/all", admin) get api("/projects/all", admin)
response.status.should == 200 response.status.should == 200
json_response.should be_an Array json_response.should be_an Array
json_response.first['name'].should == project.name project_name = project.name
json_response.first['owner']['username'].should == user.username
json_response.detect {
|project| project['name'] == project_name
}['name'].should == project_name
json_response.detect {
|project| project['owner']['username'] == user.username
}['owner']['username'].should == user.username
end end
end end
end end
......
...@@ -20,7 +20,10 @@ describe API::API, api: true do ...@@ -20,7 +20,10 @@ describe API::API, api: true do
get api("/users", user) get api("/users", user)
response.status.should == 200 response.status.should == 200
json_response.should be_an Array json_response.should be_an Array
json_response.first['username'].should == user.username username = user.username
json_response.detect {
|user| user['username'] == username
}['username'].should == username
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment