diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb index 117961834745d266dc290c134899d5f774d059b9..2875db04ee45a22fd429829ea498a4439a17357d 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 ec2d6e850966c38e582d00b830d72c50f72c7fbc..032f850010c7a46ab94f78f9f2347728d7c634ca 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 43915d8684b647d87cc58b02f301e7eff7b5cb7e..415735091c353899a4786b972640979ae6d82320 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