diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 21:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 21:07:48 +0300 |
commit | e72386771751fb22245bc6604fef236a2ee130cb (patch) | |
tree | 7cf54bca933159cb177d3caa2f139f87d6d30391 /spec/finders | |
parent | c2b98d3dbd47ab92c79c702276fe9130d9a28036 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/clusters_finder_spec.rb | 1 | ||||
-rw-r--r-- | spec/finders/group_descendants_finder_spec.rb | 1 | ||||
-rw-r--r-- | spec/finders/group_projects_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/groups_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/issues_finder_spec.rb | 1 | ||||
-rw-r--r-- | spec/finders/merge_request_target_project_finder_spec.rb | 1 | ||||
-rw-r--r-- | spec/finders/pipelines_finder_spec.rb | 1 | ||||
-rw-r--r-- | spec/finders/projects_finder_spec.rb | 2 | ||||
-rw-r--r-- | spec/finders/tags_finder_spec.rb | 1 |
9 files changed, 12 insertions, 0 deletions
diff --git a/spec/finders/clusters_finder_spec.rb b/spec/finders/clusters_finder_spec.rb index f6ea8347f67..5dde616f679 100644 --- a/spec/finders/clusters_finder_spec.rb +++ b/spec/finders/clusters_finder_spec.rb @@ -4,6 +4,7 @@ require 'spec_helper' describe ClustersFinder do let(:project) { create(:project) } + set(:user) { create(:user) } describe '#execute' do diff --git a/spec/finders/group_descendants_finder_spec.rb b/spec/finders/group_descendants_finder_spec.rb index 17875a9b9ab..ee8606e474e 100644 --- a/spec/finders/group_descendants_finder_spec.rb +++ b/spec/finders/group_descendants_finder_spec.rb @@ -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 diff --git a/spec/finders/group_projects_finder_spec.rb b/spec/finders/group_projects_finder_spec.rb index 0a7ca5211e1..89fc1e380dc 100644 --- a/spec/finders/group_projects_finder_spec.rb +++ b/spec/finders/group_projects_finder_spec.rb @@ -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 diff --git a/spec/finders/groups_finder_spec.rb b/spec/finders/groups_finder_spec.rb index 741a89a270b..939b818f165 100644 --- a/spec/finders/groups_finder_spec.rb +++ b/spec/finders/groups_finder_spec.rb @@ -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 @@ -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 diff --git a/spec/finders/issues_finder_spec.rb b/spec/finders/issues_finder_spec.rb index 6c10a617279..c52ee89006b 100644 --- a/spec/finders/issues_finder_spec.rb +++ b/spec/finders/issues_finder_spec.rb @@ -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) } diff --git a/spec/finders/merge_request_target_project_finder_spec.rb b/spec/finders/merge_request_target_project_finder_spec.rb index 7fef16d1040..4d2e4c5318c 100644 --- a/spec/finders/merge_request_target_project_finder_spec.rb +++ b/spec/finders/merge_request_target_project_finder_spec.rb @@ -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 diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb index 116088f5141..c8a4ea799c3 100644 --- a/spec/finders/pipelines_finder_spec.rb +++ b/spec/finders/pipelines_finder_spec.rb @@ -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 diff --git a/spec/finders/projects_finder_spec.rb b/spec/finders/projects_finder_spec.rb index a9344cd593a..bf97e3cf7db 100644 --- a/spec/finders/projects_finder_spec.rb +++ b/spec/finders/projects_finder_spec.rb @@ -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 @@ -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 diff --git a/spec/finders/tags_finder_spec.rb b/spec/finders/tags_finder_spec.rb index 582d82bbf79..b9de2d29895 100644 --- a/spec/finders/tags_finder_spec.rb +++ b/spec/finders/tags_finder_spec.rb @@ -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 |