summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
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