Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-13 20:39:12 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-13 20:39:12 +0400
commit8ff171f62849d5e418847c1751a802f93604cc61 (patch)
tree8c29524224d2be62a232430e9cfb83d9b2767ce5 /spec
parente8f222e39c5f7124bd604246c8d2502181760888 (diff)
Fix api specs
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/notes_spec.rb4
-rw-r--r--spec/requests/api/project_members_spec.rb12
-rw-r--r--spec/requests/api/projects_spec.rb6
3 files changed, 11 insertions, 11 deletions
diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb
index 11796183474..2875db04ee4 100644
--- a/spec/requests/api/notes_spec.rb
+++ b/spec/requests/api/notes_spec.rb
@@ -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
diff --git a/spec/requests/api/project_members_spec.rb b/spec/requests/api/project_members_spec.rb
index ec2d6e85096..032f850010c 100644
--- a/spec/requests/api/project_members_spec.rb
+++ b/spec/requests/api/project_members_spec.rb
@@ -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
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 43915d8684b..415735091c3 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -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