diff options
Diffstat (limited to 'spec/rubocop/cop/gitlab')
6 files changed, 6 insertions, 34 deletions
diff --git a/spec/rubocop/cop/gitlab/avoid_feature_get_spec.rb b/spec/rubocop/cop/gitlab/avoid_feature_get_spec.rb index b5017bebd28..1531042c23a 100644 --- a/spec/rubocop/cop/gitlab/avoid_feature_get_spec.rb +++ b/spec/rubocop/cop/gitlab/avoid_feature_get_spec.rb @@ -7,8 +7,6 @@ require_relative '../../../../rubocop/cop/gitlab/avoid_feature_get' RSpec.describe RuboCop::Cop::Gitlab::AvoidFeatureGet do let(:msg) { described_class::MSG } - subject(:cop) { described_class.new } - it 'bans use of Feature.ban' do expect_offense(<<~RUBY) Feature.get diff --git a/spec/rubocop/cop/gitlab/deprecate_track_redis_hll_event_spec.rb b/spec/rubocop/cop/gitlab/deprecate_track_redis_hll_event_spec.rb deleted file mode 100644 index eed30e11a98..00000000000 --- a/spec/rubocop/cop/gitlab/deprecate_track_redis_hll_event_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require 'rubocop_spec_helper' -require_relative '../../../../rubocop/cop/gitlab/deprecate_track_redis_hll_event' - -RSpec.describe RuboCop::Cop::Gitlab::DeprecateTrackRedisHLLEvent do - it 'does not flag the use of track_event' do - expect_no_offenses('track_event :show, name: "p_analytics_insights"') - end - - it 'flags the use of track_redis_hll_event' do - expect_offense(<<~SOURCE) - track_redis_hll_event :show, name: 'p_analytics_valuestream' - ^^^^^^^^^^^^^^^^^^^^^ `track_redis_hll_event` is deprecated[...] - SOURCE - end -end diff --git a/spec/rubocop/cop/gitlab/doc_url_spec.rb b/spec/rubocop/cop/gitlab/doc_url_spec.rb index 4a7ef14ccbc..957edc8286b 100644 --- a/spec/rubocop/cop/gitlab/doc_url_spec.rb +++ b/spec/rubocop/cop/gitlab/doc_url_spec.rb @@ -3,7 +3,7 @@ require 'rubocop_spec_helper' require_relative '../../../../rubocop/cop/gitlab/doc_url' -RSpec.describe RuboCop::Cop::Gitlab::DocUrl, feature_category: :not_owned do +RSpec.describe RuboCop::Cop::Gitlab::DocUrl, feature_category: :shared do context 'when string literal is added with docs url prefix' do context 'when inlined' do it 'registers an offense' do diff --git a/spec/rubocop/cop/gitlab/keys_first_and_values_first_spec.rb b/spec/rubocop/cop/gitlab/keys_first_and_values_first_spec.rb index 073c78e78c0..b62742d52e2 100644 --- a/spec/rubocop/cop/gitlab/keys_first_and_values_first_spec.rb +++ b/spec/rubocop/cop/gitlab/keys_first_and_values_first_spec.rb @@ -7,8 +7,6 @@ require_relative '../../../../rubocop/cop/gitlab/keys_first_and_values_first' RSpec.describe RuboCop::Cop::Gitlab::KeysFirstAndValuesFirst do let(:msg) { described_class::MSG } - subject(:cop) { described_class.new } - shared_examples 'inspect use of keys or values first' do |method, autocorrect| describe ".#{method}.first" do it 'flags and autocorrects' do diff --git a/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb b/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb index bfc0cebe203..96ff01108c3 100644 --- a/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb +++ b/spec/rubocop/cop/gitlab/mark_used_feature_flags_spec.rb @@ -201,18 +201,13 @@ RSpec.describe RuboCop::Cop::Gitlab::MarkUsedFeatureFlags do include_examples 'does not set any flags as used', 'data_consistency :delayed' end + describe 'Class with included WorkerAttributes `data_consistency` method' do + include_examples 'sets flag as used', 'ActionMailer::MailDeliveryJob.data_consistency :delayed, feature_flag: :foo', 'foo' + include_examples 'does not set any flags as used', 'data_consistency :delayed' + end + describe 'Worker `deduplicate` method' do include_examples 'sets flag as used', 'deduplicate :delayed, feature_flag: :foo', 'foo' include_examples 'does not set any flags as used', 'deduplicate :delayed' end - - describe "tracking of usage data metrics known events happens at the beginning of inspection" do - let(:usage_data_counters_known_event_feature_flags) { ['an_event_feature_flag'] } - - before do - allow(cop).to receive(:usage_data_counters_known_event_feature_flags).and_return(usage_data_counters_known_event_feature_flags) - end - - include_examples 'sets flag as used', "FEATURE_FLAG = :foo", %w[foo an_event_feature_flag] - end end diff --git a/spec/rubocop/cop/gitlab/service_response_spec.rb b/spec/rubocop/cop/gitlab/service_response_spec.rb index 84cf0dbff52..f90c84701c6 100644 --- a/spec/rubocop/cop/gitlab/service_response_spec.rb +++ b/spec/rubocop/cop/gitlab/service_response_spec.rb @@ -4,8 +4,6 @@ require 'rubocop_spec_helper' require_relative '../../../../rubocop/cop/gitlab/service_response' RSpec.describe RuboCop::Cop::Gitlab::ServiceResponse do - subject(:cop) { described_class.new } - it 'does not flag the `http_status:` param on a homonym method' do expect_no_offenses("MyClass.error(http_status: :ok)") end |