diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/controllers/projects/issues_controller_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/controllers/projects/issues_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/issues_controller_spec.rb | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index 0b3bd4d78ac..68cccfa8bde 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -1084,28 +1084,30 @@ RSpec.describe Projects::IssuesController do end context 'real-time sidebar feature flag' do - using RSpec::Parameterized::TableSyntax - let_it_be(:project) { create(:project, :public) } let_it_be(:issue) { create(:issue, project: project) } - where(:action_cable_in_app_enabled, :feature_flag_enabled, :gon_feature_flag) do - true | true | true - true | false | true - false | true | true - false | false | false + context 'when enabled' do + before do + stub_feature_flags(real_time_issue_sidebar: true) + end + + it 'pushes the correct value to the frontend' do + go(id: issue.to_param) + + expect(Gon.features).to include('realTimeIssueSidebar' => true) + end end - with_them do + context 'when disabled' do before do - expect(Gitlab::ActionCable::Config).to receive(:in_app?).and_return(action_cable_in_app_enabled) - stub_feature_flags(real_time_issue_sidebar: feature_flag_enabled) + stub_feature_flags(real_time_issue_sidebar: false) end - it 'broadcasts to the issues channel based on ActionCable and feature flag values' do + it 'pushes the correct value to the frontend' do go(id: issue.to_param) - expect(Gon.features).to include('realTimeIssueSidebar' => gon_feature_flag) + expect(Gon.features).to include('realTimeIssueSidebar' => false) end end end @@ -1406,14 +1408,14 @@ RSpec.describe Projects::IssuesController do end end - context 'when the endpoint receives requests above the limit' do + context 'when the endpoint receives requests above the limit', :freeze_time, :clean_gitlab_redis_rate_limiting do before do - stub_application_setting(issues_create_limit: 5) + stub_application_setting(issues_create_limit: 1) end context 'when issue creation limits imposed' do it 'prevents from creating more issues', :request_store do - 5.times { post_new_issue } + post_new_issue expect { post_new_issue } .to change { Gitlab::GitalyClient.get_request_count }.by(1) # creates 1 projects and 0 issues @@ -1440,7 +1442,7 @@ RSpec.describe Projects::IssuesController do project.add_developer(user) sign_in(user) - 6.times do + 2.times do post :create, params: { namespace_id: project.namespace.to_param, project_id: project, |