Commit da1f3335 authored by Arturo Herrero's avatar Arturo Herrero

Update spec with public projects under the group

This checks the inclusion/exclusion of public projects belonging to a
group for admin/users respectively.
parent 0001b8d1
......@@ -6,12 +6,10 @@ describe API::V3::Github do
let(:user) { create(:user) }
let(:unauthorized_user) { create(:user) }
let(:admin) { create(:user, :admin) }
let!(:project) { create(:project, :repository, creator: user) }
let!(:project2) { create(:project, :repository, creator: user) }
let(:project) { create(:project, :repository, creator: user) }
before do
project.add_maintainer(user)
project2.add_maintainer(user)
stub_licensed_features(jira_dev_panel_integration: true)
end
......@@ -199,6 +197,7 @@ describe API::V3::Github do
end
describe 'repo pulls' do
let(:project2) { create(:project, :repository, creator: user) }
let(:assignee) { create(:user) }
let(:assignee2) { create(:user) }
let!(:merge_request) do
......@@ -208,6 +207,10 @@ describe API::V3::Github do
create(:merge_request, source_project: project2, target_project: project2, author: user, assignees: [assignee, assignee2])
end
before do
project2.add_maintainer(user)
end
describe 'GET /-/jira/pulls' do
it 'returns an array of merge requests with github format' do
jira_get v3_api('/repos/-/jira/pulls', user)
......@@ -285,13 +288,9 @@ describe API::V3::Github do
context 'group namespace' do
let(:project) { create(:project, group: group) }
let!(:project2) { create(:project, :public, group: group) }
before do
create(:project, :public)
group.add_maintainer(user)
end
it 'returns an array of projects belonging to group with github format' do
it 'returns an array of projects excluding the public ones belonging to group with github format' do
expect_project_under_namespace([project], group, user)
end
......@@ -299,7 +298,7 @@ describe API::V3::Github do
let(:user) { create(:user, :admin) }
it 'returns an array of projects belonging to group with github format' do
expect_project_under_namespace([project], group, user)
expect_project_under_namespace([project, project2], group, user)
end
end
end
......
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