diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2014-10-06 10:19:11 +0200 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2014-10-06 10:19:11 +0200 |
commit | 86d5a63e5eed67637e8177082d224935dd10b8f9 (patch) | |
tree | d49b1bed36f78f0c56d6205124ae40ddb7807ad0 /spec/requests | |
parent | ff43500024f707a435cbcad43eb4d467368aabfe (diff) | |
download | gitlab-ce-86d5a63e5eed67637e8177082d224935dd10b8f9.tar.gz |
Fix failing api specs.
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/namespaces_spec.rb | 3 | ||||
-rw-r--r-- | spec/requests/api/projects_spec.rb | 11 | ||||
-rw-r--r-- | spec/requests/api/users_spec.rb | 5 |
3 files changed, 14 insertions, 5 deletions
diff --git a/spec/requests/api/namespaces_spec.rb b/spec/requests/api/namespaces_spec.rb index d9d52468b15..b8943ea0762 100644 --- a/spec/requests/api/namespaces_spec.rb +++ b/spec/requests/api/namespaces_spec.rb @@ -20,8 +20,7 @@ describe API::API, api: true do response.status.should == 200 json_response.should be_an Array - # Admin namespace + 2 group namespaces - json_response.length.should == 3 + json_response.length.should == Namespace.count end end end diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 571d8506277..aa1437c71aa 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -54,8 +54,15 @@ describe API::API, api: true do get api("/projects/all", admin) response.status.should == 200 json_response.should be_an Array - json_response.first['name'].should == project.name - json_response.first['owner']['username'].should == user.username + project_name = project.name + + 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 diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index b0752ebe43c..bc1598273be 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -20,7 +20,10 @@ describe API::API, api: true do get api("/users", user) response.status.should == 200 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 |