Skip to content
Snippets Groups Projects
Commit e7238677 authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent c2b98d3d
No related branches found
No related tags found
No related merge requests found
Showing
with 103 additions and 17 deletions
Loading
Loading
@@ -53,6 +53,7 @@ describe 'Private Group access' do
 
describe 'GET /groups/:path/merge_requests' do
let(:project) { create(:project, :private, :repository, group: group) }
subject { merge_requests_group_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
Loading
Loading
@@ -53,6 +53,7 @@ describe 'Public Group access' do
 
describe 'GET /groups/:path/merge_requests' do
let(:project) { create(:project, :public, :repository, group: group) }
subject { merge_requests_group_path(group) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
Loading
Loading
@@ -129,6 +129,7 @@ describe "Internal Project Access" do
 
describe "GET /:project_path/blob" do
let(:commit) { project.repository.commit }
subject { project_blob_path(project, File.join(commit.id, '.gitignore')) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -186,6 +187,7 @@ describe "Internal Project Access" do
 
describe "GET /:project_path/issues/:id/edit" do
let(:issue) { create(:issue, project: project) }
subject { edit_project_issue_path(project, issue) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -327,6 +329,7 @@ describe "Internal Project Access" do
 
describe "GET /:project_path/pipelines/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
subject { project_pipeline_path(project, pipeline) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -379,6 +382,7 @@ describe "Internal Project Access" do
describe "GET /:project_path/builds/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { project_job_path(project, build.id) }
 
context "when allowed for public and internal" do
Loading
Loading
@@ -417,6 +421,7 @@ describe "Internal Project Access" do
describe 'GET /:project_path/builds/:id/trace' do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { trace_project_job_path(project, build.id) }
 
context 'when allowed for public and internal' do
Loading
Loading
@@ -482,6 +487,7 @@ describe "Internal Project Access" do
 
describe "GET /:project_path/-/environments/:id" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_path(project, environment) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -497,6 +503,7 @@ describe "Internal Project Access" do
 
describe "GET /:project_path/-/environments/:id/deployments" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_deployments_path(project, environment) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
Loading
Loading
@@ -129,6 +129,7 @@ describe "Private Project Access" do
 
describe "GET /:project_path/blob" do
let(:commit) { project.repository.commit }
subject { project_blob_path(project, File.join(commit.id, '.gitignore')) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -186,6 +187,7 @@ describe "Private Project Access" do
 
describe "GET /:project_path/issues/:id/edit" do
let(:issue) { create(:issue, project: project) }
subject { edit_project_issue_path(project, issue) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -311,6 +313,7 @@ describe "Private Project Access" do
 
describe "GET /:project_path/pipelines/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
subject { project_pipeline_path(project, pipeline) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -365,6 +368,7 @@ describe "Private Project Access" do
describe "GET /:project_path/builds/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { project_job_path(project, build.id) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -398,6 +402,7 @@ describe "Private Project Access" do
describe 'GET /:project_path/builds/:id/trace' do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { trace_project_job_path(project, build.id) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -443,6 +448,7 @@ describe "Private Project Access" do
 
describe "GET /:project_path/-/environments/:id" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_path(project, environment) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -458,6 +464,7 @@ describe "Private Project Access" do
 
describe "GET /:project_path/-/environments/:id/deployments" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_deployments_path(project, environment) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
Loading
Loading
@@ -143,6 +143,7 @@ describe "Public Project Access" do
 
describe "GET /:project_path/pipelines/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
subject { project_pipeline_path(project, pipeline) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -195,6 +196,7 @@ describe "Public Project Access" do
describe "GET /:project_path/builds/:id" do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { project_job_path(project, build.id) }
 
context "when allowed for public" do
Loading
Loading
@@ -233,6 +235,7 @@ describe "Public Project Access" do
describe 'GET /:project_path/builds/:id/trace' do
let(:pipeline) { create(:ci_pipeline, project: project) }
let(:build) { create(:ci_build, pipeline: pipeline) }
subject { trace_project_job_path(project, build.id) }
 
context 'when allowed for public' do
Loading
Loading
@@ -298,6 +301,7 @@ describe "Public Project Access" do
 
describe "GET /:project_path/-/environments/:id" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_path(project, environment) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -313,6 +317,7 @@ describe "Public Project Access" do
 
describe "GET /:project_path/-/environments/:id/deployments" do
let(:environment) { create(:environment, project: project) }
subject { project_environment_deployments_path(project, environment) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
@@ -399,6 +404,7 @@ describe "Public Project Access" do
 
describe "GET /:project_path/issues/:id/edit" do
let(:issue) { create(:issue, project: project) }
subject { edit_project_issue_path(project, issue) }
 
it { is_expected.to be_allowed_for(:admin) }
Loading
Loading
Loading
Loading
@@ -6,30 +6,59 @@ describe 'Explore Snippets' do
let!(:public_snippet) { create(:personal_snippet, :public) }
let!(:internal_snippet) { create(:personal_snippet, :internal) }
let!(:private_snippet) { create(:personal_snippet, :private) }
let(:user) { nil }
 
it 'User should see snippets that are not private' do
sign_in create(:user)
before do
sign_in(user) if user
visit explore_snippets_path
expect(page).to have_content(public_snippet.title)
expect(page).to have_content(internal_snippet.title)
expect(page).not_to have_content(private_snippet.title)
end
 
it 'External user should see only public snippets' do
sign_in create(:user, :external)
visit explore_snippets_path
context 'User' do
let(:user) { create(:user) }
it 'see snippets that are not private' do
expect(page).to have_content(public_snippet.title)
expect(page).to have_content(internal_snippet.title)
expect(page).not_to have_content(private_snippet.title)
end
 
expect(page).to have_content(public_snippet.title)
expect(page).not_to have_content(internal_snippet.title)
expect(page).not_to have_content(private_snippet.title)
it 'shows new snippet button in header' do
parent_element = page.find('.page-title-controls')
expect(parent_element).to have_link('New snippet')
end
end
 
it 'Not authenticated user should see only public snippets' do
visit explore_snippets_path
context 'External user' do
let(:user) { create(:user, :external) }
it 'see only public snippets' do
expect(page).to have_content(public_snippet.title)
expect(page).not_to have_content(internal_snippet.title)
expect(page).not_to have_content(private_snippet.title)
end
context 'without snippets' do
before do
Snippet.delete_all
end
it 'hides new snippet button' do
expect(page).not_to have_link('New snippet')
end
end
context 'with snippets' do
it 'hides new snippet button' do
expect(page).not_to have_link('New snippet')
end
end
end
 
expect(page).to have_content(public_snippet.title)
expect(page).not_to have_content(internal_snippet.title)
expect(page).not_to have_content(private_snippet.title)
context 'Not authenticated user' do
it 'see only public snippets' do
expect(page).to have_content(public_snippet.title)
expect(page).not_to have_content(internal_snippet.title)
expect(page).not_to have_content(private_snippet.title)
end
end
end
Loading
Loading
@@ -146,6 +146,7 @@ describe 'Task Lists' do
 
describe 'for Notes' do
let!(:issue) { create(:issue, author: user, project: project) }
describe 'multiple tasks' do
let!(:note) do
create(:note, note: markdown, noteable: issue,
Loading
Loading
Loading
Loading
@@ -406,6 +406,7 @@ describe 'Login' do
 
describe 'with required two-factor authentication enabled' do
let(:user) { create(:user) }
# TODO: otp_grace_period_started_at
 
context 'global setting' do
Loading
Loading
Loading
Loading
@@ -4,6 +4,7 @@ require 'spec_helper'
 
describe ClustersFinder do
let(:project) { create(:project) }
set(:user) { create(:user) }
 
describe '#execute' do
Loading
Loading
Loading
Loading
@@ -6,6 +6,7 @@ describe GroupDescendantsFinder do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:params) { {} }
subject(:finder) do
described_class.new(current_user: user, parent_group: group, params: params)
end
Loading
Loading
Loading
Loading
@@ -132,11 +132,13 @@ describe GroupProjectsFinder do
 
context "only shared" do
let(:options) { { only_shared: true } }
it { is_expected.to eq([shared_project_3, shared_project_2, shared_project_1]) }
end
 
context "only owned" do
let(:options) { { only_owned: true } }
it { is_expected.to eq([private_project, public_project]) }
end
 
Loading
Loading
Loading
Loading
@@ -111,6 +111,7 @@ describe GroupsFinder do
context 'authorized to private project' do
context 'project one level deep' do
let!(:subproject) { create(:project, :private, namespace: private_subgroup) }
before do
subproject.add_guest(user)
end
Loading
Loading
@@ -129,6 +130,7 @@ describe GroupsFinder do
context 'project two levels deep' do
let!(:private_subsubgroup) { create(:group, :private, parent: private_subgroup) }
let!(:subsubproject) { create(:project, :private, namespace: private_subsubgroup) }
before do
subsubproject.add_guest(user)
end
Loading
Loading
Loading
Loading
@@ -786,6 +786,7 @@ describe IssuesFinder do
 
describe '#with_confidentiality_access_check' do
let(:guest) { create(:user) }
set(:authorized_user) { create(:user) }
set(:project) { create(:project, namespace: authorized_user.namespace) }
set(:public_issue) { create(:issue, project: project) }
Loading
Loading
Loading
Loading
@@ -6,6 +6,7 @@ describe MergeRequestTargetProjectFinder do
include ProjectForksHelper
 
let(:user) { create(:user) }
subject(:finder) { described_class.new(current_user: user, source_project: forked_project) }
 
shared_examples 'finding related projects' do
Loading
Loading
Loading
Loading
@@ -6,6 +6,7 @@ describe PipelinesFinder do
let(:project) { create(:project, :public, :repository) }
let(:current_user) { nil }
let(:params) { {} }
subject { described_class.new(project, current_user, params).execute }
 
describe "#execute" do
Loading
Loading
Loading
Loading
@@ -181,6 +181,7 @@ describe ProjectsFinder, :do_not_mock_admin_mode do
 
describe 'filter by non_public' do
let(:params) { { non_public: true } }
before do
private_project.add_developer(current_user)
end
Loading
Loading
@@ -190,6 +191,7 @@ describe ProjectsFinder, :do_not_mock_admin_mode do
 
describe 'filter by starred' do
let(:params) { { starred: true } }
before do
current_user.toggle_star(public_project)
end
Loading
Loading
Loading
Loading
@@ -96,6 +96,7 @@ describe TagsFinder do
 
context 'filter and sort' do
let(:tags_to_compare) { %w[v1.0.0 v1.1.0] }
subject { described_class.new(repository, params).execute.select { |tag| tags_to_compare.include?(tag.name) } }
 
context 'when sort by updated_desc' do
Loading
Loading
Loading
Loading
@@ -99,6 +99,15 @@
"access_level": 50,
"notification_level": 3
}
},
"_links": {
"self": "https://gitlab.com/api/v4/projects/278964",
"issues": "https://gitlab.com/api/v4/projects/278964/issues",
"merge_requests": "https://gitlab.com/api/v4/projects/278964/merge_requests",
"repo_branches": "https://gitlab.com/api/v4/projects/278964/repository/branches",
"labels": "https://gitlab.com/api/v4/projects/278964/labels",
"events": "https://gitlab.com/api/v4/projects/278964/events",
"members": "https://gitlab.com/api/v4/projects/278964/members"
}
}, {
"id": 7,
Loading
Loading
import './get_client_rects';
import './inner_text';
// workaround for JSDOM not supporting innerText
// see https://github.com/jsdom/jsdom/issues/1245
Object.defineProperty(global.Element.prototype, 'innerText', {
get() {
return this.textContent;
},
set(value) {
this.textContext = value;
},
configurable: true, // make it so that it doesn't blow chunks on re-running tests with things like --watch
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment