Commit cd846ba2b55cd1380febfa174d8cf82ad9e948f7
1 parent
94c50545
Exists in
master
and in
4 other branches
Fix tests
Showing
1 changed file
with
3 additions
and
4 deletions
Show diff stats
spec/requests/api/projects_spec.rb
@@ -4,6 +4,8 @@ describe Gitlab::API do | @@ -4,6 +4,8 @@ describe Gitlab::API do | ||
4 | include ApiHelpers | 4 | include ApiHelpers |
5 | 5 | ||
6 | let(:user) { Factory :user } | 6 | let(:user) { Factory :user } |
7 | + let(:user2) { Factory.create(:user) } | ||
8 | + let(:user3) { Factory.create(:user) } | ||
7 | let!(:project) { Factory :project, owner: user } | 9 | let!(:project) { Factory :project, owner: user } |
8 | let!(:snippet) { Factory :snippet, author: user, project: project, title: 'example' } | 10 | let!(:snippet) { Factory :snippet, author: user, project: project, title: 'example' } |
9 | before { project.add_access(user, :read) } | 11 | before { project.add_access(user, :read) } |
@@ -63,13 +65,10 @@ describe Gitlab::API do | @@ -63,13 +65,10 @@ describe Gitlab::API do | ||
63 | end | 65 | end |
64 | 66 | ||
65 | describe "PUT /projects/:id/add_users" do | 67 | describe "PUT /projects/:id/add_users" do |
66 | - @user2 = Factory :user | ||
67 | - @user3 = Factory :user | ||
68 | - | ||
69 | it "should add users to existing project" do | 68 | it "should add users to existing project" do |
70 | expect { | 69 | expect { |
71 | put api("/projects/#{project.code}/add_users", user), | 70 | put api("/projects/#{project.code}/add_users", user), |
72 | - user_ids: [@user2.id, @user3.id], project_access: UsersProject::DEVELOPER | 71 | + user_ids: [user2.id, user3.id], project_access: UsersProject::DEVELOPER |
73 | }.to change {Project.last.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(2) | 72 | }.to change {Project.last.users_projects.where(:project_access => UsersProject::DEVELOPER).count}.by(2) |
74 | end | 73 | end |
75 | end | 74 | end |