diff options
author | Luke Bennett <lbennett@gitlab.com> | 2018-12-06 16:41:20 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2019-01-03 21:39:36 +0300 |
commit | 5f110a6acff7571126c22013923d3f5d2aab770d (patch) | |
tree | a60fdc9812d72f942ca85698517c0b967f1c09fa /spec/features | |
parent | 24665ccbe13134bf8379dc68ddfbe80f6c035808 (diff) |
Port GitLab.com gold trial callout changes to CE
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8731
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/dashboard/merge_requests_spec.rb | 1 | ||||
-rw-r--r-- | spec/features/dashboard/root_explore_spec.rb | 33 | ||||
-rw-r--r-- | spec/features/explore/user_explores_projects_spec.rb | 18 |
3 files changed, 34 insertions, 18 deletions
diff --git a/spec/features/dashboard/merge_requests_spec.rb b/spec/features/dashboard/merge_requests_spec.rb index 282bf542e77..9ffa75aee47 100644 --- a/spec/features/dashboard/merge_requests_spec.rb +++ b/spec/features/dashboard/merge_requests_spec.rb @@ -6,6 +6,7 @@ describe 'Dashboard Merge Requests' do include ProjectForksHelper let(:current_user) { create :user } + let(:user) { current_user } let(:project) { create(:project) } let(:public_project) { create(:project, :public, :repository) } diff --git a/spec/features/dashboard/root_explore_spec.rb b/spec/features/dashboard/root_explore_spec.rb new file mode 100644 index 00000000000..5b686d8b6f1 --- /dev/null +++ b/spec/features/dashboard/root_explore_spec.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'Root explore' do + set(:public_project) { create(:project, :public) } + set(:archived_project) { create(:project, :archived) } + set(:internal_project) { create(:project, :internal) } + set(:private_project) { create(:project, :private) } + + before do + allow(Gitlab).to receive(:com?).and_return(true) + end + + context 'when logged in' do + set(:user) { create(:user) } + + before do + sign_in(user) + visit explore_projects_path + end + + include_examples 'shows public and internal projects' + end + + context 'when not logged in' do + before do + visit explore_projects_path + end + + include_examples 'shows public projects' + end +end diff --git a/spec/features/explore/user_explores_projects_spec.rb b/spec/features/explore/user_explores_projects_spec.rb index 6ac9497b024..c724c3d17f8 100644 --- a/spec/features/explore/user_explores_projects_spec.rb +++ b/spec/features/explore/user_explores_projects_spec.rb @@ -6,24 +6,6 @@ describe 'User explores projects' do set(:private_project) { create(:project, :private) } set(:public_project) { create(:project, :public) } - shared_examples_for 'shows public projects' do - it 'shows projects' do - expect(page).to have_content(public_project.title) - expect(page).not_to have_content(internal_project.title) - expect(page).not_to have_content(private_project.title) - expect(page).not_to have_content(archived_project.title) - end - end - - shared_examples_for 'shows public and internal projects' do - it 'shows projects' do - expect(page).to have_content(public_project.title) - expect(page).to have_content(internal_project.title) - expect(page).not_to have_content(private_project.title) - expect(page).not_to have_content(archived_project.title) - end - end - context 'when not signed in' do context 'when viewing public projects' do before do |