Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
commit43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch)
treedceebdc68925362117480a5d672bcff122fb625b /spec/controllers/explore
parent20c84b99005abd1c82101dfeff264ac50d2df211 (diff)
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'spec/controllers/explore')
-rw-r--r--spec/controllers/explore/groups_controller_spec.rb4
-rw-r--r--spec/controllers/explore/projects_controller_spec.rb20
2 files changed, 22 insertions, 2 deletions
diff --git a/spec/controllers/explore/groups_controller_spec.rb b/spec/controllers/explore/groups_controller_spec.rb
index a3bd8102462..76bd94fd681 100644
--- a/spec/controllers/explore/groups_controller_spec.rb
+++ b/spec/controllers/explore/groups_controller_spec.rb
@@ -41,9 +41,9 @@ RSpec.describe Explore::GroupsController do
it_behaves_like 'explore groups'
- context 'generic_explore_groups flag is disabled' do
+ context 'gitlab.com' do
before do
- stub_feature_flags(generic_explore_groups: false)
+ allow(Gitlab).to receive(:com?).and_return(true)
end
it_behaves_like 'explore groups'
diff --git a/spec/controllers/explore/projects_controller_spec.rb b/spec/controllers/explore/projects_controller_spec.rb
index c4f0feb21e2..c2bdb0171e7 100644
--- a/spec/controllers/explore/projects_controller_spec.rb
+++ b/spec/controllers/explore/projects_controller_spec.rb
@@ -239,9 +239,14 @@ RSpec.describe Explore::ProjectsController, feature_category: :projects do
context 'when user is signed in' do
let(:user) { create(:user) }
+ let_it_be(:project) { create(:project, name: 'Project 1') }
+ let_it_be(:project2) { create(:project, name: 'Project 2') }
before do
sign_in(user)
+ project.add_developer(user)
+ project2.add_developer(user)
+ user.toggle_star(project2)
end
include_examples 'explore projects'
@@ -260,6 +265,21 @@ RSpec.describe Explore::ProjectsController, feature_category: :projects do
let(:controller_action) { :index }
let(:params_with_name) { { name: 'some project' } }
+ it 'assigns the correct all_user_projects' do
+ get :index
+ all_user_projects = assigns(:all_user_projects)
+
+ expect(all_user_projects.count).to eq(2)
+ end
+
+ it 'assigns the correct all_starred_projects' do
+ get :index
+ all_starred_projects = assigns(:all_starred_projects)
+
+ expect(all_starred_projects.count).to eq(1)
+ expect(all_starred_projects).to include(project2)
+ end
+
context 'when disable_anonymous_project_search is enabled' do
before do
stub_feature_flags(disable_anonymous_project_search: true)