Commit 4d675052 authored by Rémy Coutable's avatar Rémy Coutable

Fix failing specs after project authorizations rework

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 61b861cc
......@@ -23,8 +23,8 @@ describe AutocompleteController do
let(:body) { JSON.parse(response.body) }
it { expect(body).to be_kind_of(Array) }
it { expect(body.size).to eq 2 }
it { expect(body.map { |u| u["username"] }).to match_array([user.username, user2.username]) }
it { expect(body.size).to eq 3 }
it { expect(body.map { |u| u["username"] }).to match_array([project.owner.username, user.username, user2.username]) }
end
describe 'GET #users with unknown project' do
......@@ -43,8 +43,8 @@ describe AutocompleteController do
let(:body) { JSON.parse(response.body) }
it { expect(body).to be_kind_of(Array) }
it { expect(body.size).to eq 1 }
it { expect(body.first["username"]).to eq user.username }
it { expect(body.size).to eq 2 }
it { expect(body.map { |u| u["username"] }).to match_array([project.owner.username, user.username]) }
end
describe "GET #users that can push code" do
......@@ -58,8 +58,8 @@ describe AutocompleteController do
let(:body) { JSON.parse(response.body) }
it { expect(body).to be_kind_of(Array) }
it { expect(body.size).to eq 2 }
it { expect(body.map { |user| user["username"] }).to match_array([user.username, user2.username]) }
it { expect(body.size).to eq 3 }
it { expect(body.map { |user| user["username"] }).to match_array([project.owner.username, user.username, user2.username]) }
end
describe "GET #users that can push to protected branches, including the current user" do
......@@ -70,8 +70,8 @@ describe AutocompleteController do
let(:body) { JSON.parse(response.body) }
it { expect(body).to be_kind_of(Array) }
it { expect(body.size).to eq 1 }
it { expect(body.first["username"]).to eq user.username }
it { expect(body.size).to eq 2 }
it { expect(body.map { |u| u["username"] }).to match_array([project.owner.username, user.username]) }
end
end
......
......@@ -289,7 +289,7 @@ describe Projects::MergeRequestsController do
recorded = ActiveRecord::QueryRecorder.new { go(format: :json) }
expect(recorded.count).to be_within(5).of(95)
expect(recorded.count).to be_within(10).of(100)
expect(recorded.cached_count).to eq(0)
end
end
......
......@@ -564,7 +564,7 @@ describe MergeRequest, models: true do
project.team << [developer, :developer]
project.team << [blocked_developer, :developer]
expect(merge_request.number_of_potential_approvers).to eq(1)
expect(merge_request.number_of_potential_approvers).to eq(2)
end
context "when the project is part of a group" do
......@@ -1520,7 +1520,7 @@ describe MergeRequest, models: true do
end
it 'does not require approval for the merge request' do
expect(merge_request.approvals_left).to eq(0)
expect(merge_request.approvals_left).to eq(1)
end
it 'does not allow the approver to approve the MR' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment