summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-10-06 10:19:11 +0200
committerMarin Jankovski <maxlazio@gmail.com>2014-10-06 10:19:11 +0200
commit86d5a63e5eed67637e8177082d224935dd10b8f9 (patch)
treed49b1bed36f78f0c56d6205124ae40ddb7807ad0 /spec/requests
parentff43500024f707a435cbcad43eb4d467368aabfe (diff)
downloadgitlab-ce-86d5a63e5eed67637e8177082d224935dd10b8f9.tar.gz
Fix failing api specs.
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/namespaces_spec.rb3
-rw-r--r--spec/requests/api/projects_spec.rb11
-rw-r--r--spec/requests/api/users_spec.rb5
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