diff options
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/awardable_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/concerns/case_sensitivity_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/concerns/featurable_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/concerns/ignorable_columns_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/concerns/issuable_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/concerns/pg_full_text_searchable_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/concerns/project_features_compatibility_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/concerns/reactive_caching_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/concerns/sortable_spec.rb | 22 |
9 files changed, 30 insertions, 30 deletions
diff --git a/spec/models/concerns/awardable_spec.rb b/spec/models/concerns/awardable_spec.rb index fcd0d0c05f4..828b75aceb0 100644 --- a/spec/models/concerns/awardable_spec.rb +++ b/spec/models/concerns/awardable_spec.rb @@ -102,7 +102,7 @@ RSpec.describe Awardable do end it "includes unused thumbs buttons by default" do - expect(note_without_downvote.grouped_awards.keys.sort).to eq %w(thumbsdown thumbsup) + expect(note_without_downvote.grouped_awards.keys.sort).to eq %w[thumbsdown thumbsup] end it "doesn't include unused thumbs buttons when disabled in project" do @@ -114,7 +114,7 @@ RSpec.describe Awardable do it "includes unused thumbs buttons when enabled in project" do note_without_downvote.project.show_default_award_emojis = true - expect(note_without_downvote.grouped_awards.keys.sort).to eq %w(thumbsdown thumbsup) + expect(note_without_downvote.grouped_awards.keys.sort).to eq %w[thumbsdown thumbsup] end it "doesn't include unused thumbs buttons in summary" do @@ -124,11 +124,11 @@ RSpec.describe Awardable do it "includes used thumbs buttons when disabled in project" do note_with_downvote.project.show_default_award_emojis = false - expect(note_with_downvote.grouped_awards.keys).to eq %w(thumbsdown) + expect(note_with_downvote.grouped_awards.keys).to eq %w[thumbsdown] end it "includes used thumbs buttons in summary" do - expect(note_with_downvote.grouped_awards(with_thumbs: false).keys).to eq %w(thumbsdown) + expect(note_with_downvote.grouped_awards(with_thumbs: false).keys).to eq %w[thumbsdown] end end end diff --git a/spec/models/concerns/case_sensitivity_spec.rb b/spec/models/concerns/case_sensitivity_spec.rb index 6e624c687c4..a8e52904873 100644 --- a/spec/models/concerns/case_sensitivity_spec.rb +++ b/spec/models/concerns/case_sensitivity_spec.rb @@ -21,11 +21,11 @@ RSpec.describe CaseSensitivity do end it 'finds multiple instances by a single attribute regardless of case' do - expect(model.iwhere(path: %w(MODEL-1 model-2))).to contain_exactly(model_1, model_2) + expect(model.iwhere(path: %w[MODEL-1 model-2])).to contain_exactly(model_1, model_2) end it 'finds instances by multiple attributes' do - expect(model.iwhere(path: %w(MODEL-1 model-2), name: 'model 1')) + expect(model.iwhere(path: %w[MODEL-1 model-2], name: 'model 1')) .to contain_exactly(model_1) end @@ -34,7 +34,7 @@ RSpec.describe CaseSensitivity do end it 'builds a query using LOWER' do - query = model.iwhere(path: %w(MODEL-1 model-2), name: 'model 1').to_sql + query = model.iwhere(path: %w[MODEL-1 model-2], name: 'model 1').to_sql expected_query = <<~QRY.strip SELECT \"namespaces\".* FROM \"namespaces\" WHERE (LOWER(\"namespaces\".\"path\") IN (LOWER('MODEL-1'), LOWER('model-2'))) AND (LOWER(\"namespaces\".\"name\") = LOWER('model 1')) QRY diff --git a/spec/models/concerns/featurable_spec.rb b/spec/models/concerns/featurable_spec.rb index bf104fe1b30..97ad4fc8bdd 100644 --- a/spec/models/concerns/featurable_spec.rb +++ b/spec/models/concerns/featurable_spec.rb @@ -9,7 +9,7 @@ RSpec.describe Featurable do self.table_name = 'project_features' - set_available_features %i(feature1 feature2 feature3) + set_available_features %i[feature1 feature2 feature3] def feature1_access_level Featurable::DISABLED diff --git a/spec/models/concerns/ignorable_columns_spec.rb b/spec/models/concerns/ignorable_columns_spec.rb index c97dc606159..339f06f9c45 100644 --- a/spec/models/concerns/ignorable_columns_spec.rb +++ b/spec/models/concerns/ignorable_columns_spec.rb @@ -14,13 +14,13 @@ RSpec.describe IgnorableColumns do it 'adds columns to ignored_columns' do expect do subject.ignore_columns(:name, :created_at, remove_after: '2019-12-01', remove_with: '12.6') - end.to change { subject.ignored_columns }.from([]).to(%w(name created_at)) + end.to change { subject.ignored_columns }.from([]).to(%w[name created_at]) end it 'adds columns to ignored_columns (array version)' do expect do subject.ignore_columns(%i[name created_at], remove_after: '2019-12-01', remove_with: '12.6') - end.to change { subject.ignored_columns }.from([]).to(%w(name created_at)) + end.to change { subject.ignored_columns }.from([]).to(%w[name created_at]) end it 'requires remove_after attribute to be set' do diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 705f8f46a90..d61a465b39f 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -597,7 +597,7 @@ RSpec.describe Issuable, feature_category: :team_planning do expect(builder).to receive(:build).with( user: user, changes: hash_including( - 'severity' => %w(unknown low) + 'severity' => %w[unknown low] )) issue.to_hook_data(user, old_associations: { severity: 'unknown' }) @@ -618,7 +618,7 @@ RSpec.describe Issuable, feature_category: :team_planning do expect(builder).to receive(:build).with( user: user, changes: hash_including( - 'escalation_status' => %i(triggered acknowledged) + 'escalation_status' => %i[triggered acknowledged] )) issue.to_hook_data(user, old_associations: { escalation_status: :triggered }) diff --git a/spec/models/concerns/pg_full_text_searchable_spec.rb b/spec/models/concerns/pg_full_text_searchable_spec.rb index 059df64f7d0..8e3b65cf125 100644 --- a/spec/models/concerns/pg_full_text_searchable_spec.rb +++ b/spec/models/concerns/pg_full_text_searchable_spec.rb @@ -18,7 +18,7 @@ RSpec.describe PgFullTextSearchable, feature_category: :global_search do before_validation -> { self.work_item_type_id = ::WorkItems::Type.default_issue_type.id } def persist_pg_full_text_search_vector(search_vector) - Issues::SearchData.upsert({ project_id: project_id, issue_id: id, search_vector: search_vector }, unique_by: %i(project_id issue_id)) + Issues::SearchData.upsert({ project_id: project_id, issue_id: id, search_vector: search_vector }, unique_by: %i[project_id issue_id]) end def self.name @@ -95,7 +95,7 @@ RSpec.describe PgFullTextSearchable, feature_category: :global_search do matching_object = model_class.create!(project: project, namespace: project.project_namespace, title: 'english', description: 'some description') matching_object.update_search_data! - expect(model_class.pg_full_text_search('english', matched_columns: %w(title))).to contain_exactly(matching_object) + expect(model_class.pg_full_text_search('english', matched_columns: %w[title])).to contain_exactly(matching_object) end it 'uses prefix matching' do diff --git a/spec/models/concerns/project_features_compatibility_spec.rb b/spec/models/concerns/project_features_compatibility_spec.rb index f168bedc8eb..46390fa735b 100644 --- a/spec/models/concerns/project_features_compatibility_spec.rb +++ b/spec/models/concerns/project_features_compatibility_spec.rb @@ -4,12 +4,12 @@ require 'spec_helper' RSpec.describe ProjectFeaturesCompatibility do let(:project) { create(:project) } - let(:features_enabled) { %w(issues wiki builds merge_requests snippets security_and_compliance) } + let(:features_enabled) { %w[issues wiki builds merge_requests snippets security_and_compliance] } let(:features) do - features_enabled + %w( + features_enabled + %w[ repository pages operations container_registry package_registry environments feature_flags releases monitor infrastructure - ) + ] end # We had issues_enabled, snippets_enabled, builds_enabled, merge_requests_enabled and issues_enabled fields on projects table diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb index 039b9e574fe..324759fc7ee 100644 --- a/spec/models/concerns/reactive_caching_spec.rb +++ b/spec/models/concerns/reactive_caching_spec.rb @@ -176,7 +176,7 @@ RSpec.describe ReactiveCaching, :use_clean_rails_memory_store_caching do describe '.reactive_cache_worker_finder' do context 'with default reactive_cache_worker_finder' do - let(:args) { %w(other args) } + let(:args) { %w[other args] } before do allow(instance.class).to receive(:find_by).with(id: instance.id) @@ -192,7 +192,7 @@ RSpec.describe ReactiveCaching, :use_clean_rails_memory_store_caching do end context 'with custom reactive_cache_worker_finder' do - let(:args) { %w(arg1 arg2) } + let(:args) { %w[arg1 arg2] } let(:instance) { custom_finder_cache_test.new(666, &calculation) } let(:custom_finder_cache_test) do diff --git a/spec/models/concerns/sortable_spec.rb b/spec/models/concerns/sortable_spec.rb index f1ae89f33af..98f4ab4f521 100644 --- a/spec/models/concerns/sortable_spec.rb +++ b/spec/models/concerns/sortable_spec.rb @@ -14,14 +14,14 @@ RSpec.describe Sortable do it 'allows secondary ordering by id ascending' do orders = arel_orders(sorted_relation.with_order_id_asc) - expect(orders.map { |arel| arel.expr.name }).to eq(%w(created_at id)) + expect(orders.map { |arel| arel.expr.name }).to eq(%w[created_at id]) expect(orders).to all(be_kind_of(Arel::Nodes::Ascending)) end it 'allows secondary ordering by id descending' do orders = arel_orders(sorted_relation.with_order_id_desc) - expect(orders.map { |arel| arel.expr.name }).to eq(%w(created_at id)) + expect(orders.map { |arel| arel.expr.name }).to eq(%w[created_at id]) expect(orders.first).to be_kind_of(Arel::Nodes::Ascending) expect(orders.last).to be_kind_of(Arel::Nodes::Descending) end @@ -123,24 +123,24 @@ RSpec.describe Sortable do let!(:group4) { create(:group, name: 'bbb', id: 4, created_at: ref_time, updated_at: ref_time - 15.seconds) } it 'sorts groups by id' do - expect(ordered_group_names('id_asc')).to eq(%w(aa AAA BB bbb)) - expect(ordered_group_names('id_desc')).to eq(%w(bbb BB AAA aa)) + expect(ordered_group_names('id_asc')).to eq(%w[aa AAA BB bbb]) + expect(ordered_group_names('id_desc')).to eq(%w[bbb BB AAA aa]) end it 'sorts groups by name via case-insensitive comparision' do - expect(ordered_group_names('name_asc')).to eq(%w(aa AAA BB bbb)) - expect(ordered_group_names('name_desc')).to eq(%w(bbb BB AAA aa)) + expect(ordered_group_names('name_asc')).to eq(%w[aa AAA BB bbb]) + expect(ordered_group_names('name_desc')).to eq(%w[bbb BB AAA aa]) end it 'sorts groups by created_at' do - expect(ordered_group_names('created_asc')).to eq(%w(aa AAA BB bbb)) - expect(ordered_group_names('created_desc')).to eq(%w(bbb BB AAA aa)) - expect(ordered_group_names('created_date')).to eq(%w(bbb BB AAA aa)) + expect(ordered_group_names('created_asc')).to eq(%w[aa AAA BB bbb]) + expect(ordered_group_names('created_desc')).to eq(%w[bbb BB AAA aa]) + expect(ordered_group_names('created_date')).to eq(%w[bbb BB AAA aa]) end it 'sorts groups by updated_at' do - expect(ordered_group_names('updated_asc')).to eq(%w(bbb BB AAA aa)) - expect(ordered_group_names('updated_desc')).to eq(%w(aa AAA BB bbb)) + expect(ordered_group_names('updated_asc')).to eq(%w[bbb BB AAA aa]) + expect(ordered_group_names('updated_desc')).to eq(%w[aa AAA BB bbb]) end end end |