diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9dfed888ab..5fd8c4b6b5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -221,30 +221,11 @@ Metrics/PerceivedComplexity: - 'app/models/spree/ability.rb' - 'app/models/spree/order/checkout.rb' -# Offense count: 56 +# Offense count: 37 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Inferences. RSpecRails/InferredSpecType: Exclude: - - 'spec/helpers/admin/enterprises_helper_spec.rb' - - 'spec/helpers/admin/orders_helper_spec.rb' - - 'spec/helpers/admin/reports_helper_spec.rb' - - 'spec/helpers/admin/subscriptions_helper_spec.rb' - - 'spec/helpers/application_helper_spec.rb' - - 'spec/helpers/checkout_helper_spec.rb' - - 'spec/helpers/i18n_helper_spec.rb' - - 'spec/helpers/injection_helper_spec.rb' - - 'spec/helpers/link_helper_spec.rb' - - 'spec/helpers/navigation_helper_spec.rb' - - 'spec/helpers/order_cycles_helper_spec.rb' - - 'spec/helpers/serializer_helper_spec.rb' - - 'spec/helpers/shop_helper_spec.rb' - - 'spec/helpers/spree/admin/base_helper_spec.rb' - - 'spec/helpers/spree/admin/general_settings_helper_spec.rb' - - 'spec/helpers/spree/admin/orders_helper_spec.rb' - - 'spec/helpers/spree/orders_helper_spec.rb' - - 'spec/helpers/tax_helper_spec.rb' - - 'spec/helpers/terms_and_conditions_helper_spec.rb' - 'spec/jobs/connect_app_job_spec.rb' - 'spec/mailers/producer_mailer_spec.rb' - 'spec/mailers/subscription_mailer_spec.rb' diff --git a/spec/helpers/admin/enterprises_helper_spec.rb b/spec/helpers/admin/enterprises_helper_spec.rb index aae01ab5ea..cbb9c72ffd 100644 --- a/spec/helpers/admin/enterprises_helper_spec.rb +++ b/spec/helpers/admin/enterprises_helper_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe Admin::EnterprisesHelper, type: :helper do +RSpec.describe Admin::EnterprisesHelper do let(:user) { build(:user) } before do diff --git a/spec/helpers/admin/orders_helper_spec.rb b/spec/helpers/admin/orders_helper_spec.rb index a9b301af5e..9a1f9e9306 100644 --- a/spec/helpers/admin/orders_helper_spec.rb +++ b/spec/helpers/admin/orders_helper_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -RSpec.describe Admin::OrdersHelper, type: :helper do +RSpec.describe Admin::OrdersHelper do describe "#order_adjustments_for_display" do let(:order) { create(:order) } let(:service) { instance_double(VoucherAdjustmentsService, voucher_included_tax:) } diff --git a/spec/helpers/admin/reports_helper_spec.rb b/spec/helpers/admin/reports_helper_spec.rb index 0cd63d9037..6f2f0c33e4 100644 --- a/spec/helpers/admin/reports_helper_spec.rb +++ b/spec/helpers/admin/reports_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe ReportsHelper, type: :helper do +RSpec.describe ReportsHelper do describe "#report_payment_method_options" do let(:order_with_payments) { create(:order_ready_to_ship) } let(:order_without_payments) { create(:order_with_line_items) } diff --git a/spec/helpers/admin/subscriptions_helper_spec.rb b/spec/helpers/admin/subscriptions_helper_spec.rb index f4dc888ab3..c5e3ef23fa 100644 --- a/spec/helpers/admin/subscriptions_helper_spec.rb +++ b/spec/helpers/admin/subscriptions_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Admin::SubscriptionsHelper, type: :helper do +RSpec.describe Admin::SubscriptionsHelper do describe "checking if setup is complete for any [shop]" do let(:shop) { create(:distributor_enterprise) } let(:customer) { create(:customer, enterprise: shop) } diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index c9aa5c7b0d..fe2679359c 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe ApplicationHelper, type: :helper do +RSpec.describe ApplicationHelper do describe "#feature?" do it "takes several actors" do user = Spree::User.new(id: 4) diff --git a/spec/helpers/checkout_helper_spec.rb b/spec/helpers/checkout_helper_spec.rb index a6f8350a24..1303cdb148 100644 --- a/spec/helpers/checkout_helper_spec.rb +++ b/spec/helpers/checkout_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe CheckoutHelper, type: :helper do +RSpec.describe CheckoutHelper do it "generates html for validated inputs" do expect(helper).to receive(:render).with( "shared/validated_input", diff --git a/spec/helpers/i18n_helper_spec.rb b/spec/helpers/i18n_helper_spec.rb index d8434d228c..884e010c85 100644 --- a/spec/helpers/i18n_helper_spec.rb +++ b/spec/helpers/i18n_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe I18nHelper, type: :helper do +RSpec.describe I18nHelper do let(:user) { create(:user) } let(:cookies) { {} } diff --git a/spec/helpers/injection_helper_spec.rb b/spec/helpers/injection_helper_spec.rb index 1001d763a1..cd0b57d29b 100644 --- a/spec/helpers/injection_helper_spec.rb +++ b/spec/helpers/injection_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe InjectionHelper, type: :helper do +RSpec.describe InjectionHelper do let!(:enterprise) { create(:distributor_enterprise, facebook: "roger") } let!(:distributor1) { create(:distributor_enterprise) } diff --git a/spec/helpers/link_helper_spec.rb b/spec/helpers/link_helper_spec.rb index cf7c6a07c5..14dc507343 100644 --- a/spec/helpers/link_helper_spec.rb +++ b/spec/helpers/link_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe LinkHelper, type: :helper do +RSpec.describe LinkHelper do describe "ext_url" do it "adds prefix if missing" do expect(helper.ext_url("http://example.com/", "http://example.com/bla")).to eq("http://example.com/bla") diff --git a/spec/helpers/navigation_helper_spec.rb b/spec/helpers/navigation_helper_spec.rb index e5a9a40c00..d2bc2be68d 100644 --- a/spec/helpers/navigation_helper_spec.rb +++ b/spec/helpers/navigation_helper_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' module Spree module Admin - RSpec.describe NavigationHelper, type: :helper do + RSpec.describe NavigationHelper do describe "klass_for" do it "returns the class when present" do expect(helper.klass_for('products')).to eq(Spree::Product) diff --git a/spec/helpers/order_cycles_helper_spec.rb b/spec/helpers/order_cycles_helper_spec.rb index aaf39267bc..97d9f2bad9 100644 --- a/spec/helpers/order_cycles_helper_spec.rb +++ b/spec/helpers/order_cycles_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe OrderCyclesHelper, type: :helper do +RSpec.describe OrderCyclesHelper do let(:oc) { double(:order_cycle) } describe "finding producer enterprise options" do diff --git a/spec/helpers/serializer_helper_spec.rb b/spec/helpers/serializer_helper_spec.rb index 911515a7c3..d41ccc2d73 100644 --- a/spec/helpers/serializer_helper_spec.rb +++ b/spec/helpers/serializer_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe SerializerHelper, type: :helper do +RSpec.describe SerializerHelper do let(:serializer) do Class.new(ActiveModel::Serializer) do attributes :id, :name diff --git a/spec/helpers/shop_helper_spec.rb b/spec/helpers/shop_helper_spec.rb index e59881d6ef..08697cb6cf 100644 --- a/spec/helpers/shop_helper_spec.rb +++ b/spec/helpers/shop_helper_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: false require 'spec_helper' -RSpec.describe ShopHelper, type: :helper do +RSpec.describe ShopHelper do describe "shop_tabs" do context "distributor with groups" do let(:group) { create(:enterprise_group) } diff --git a/spec/helpers/spree/admin/base_helper_spec.rb b/spec/helpers/spree/admin/base_helper_spec.rb index 958f7f2ae1..090cdd63d1 100644 --- a/spec/helpers/spree/admin/base_helper_spec.rb +++ b/spec/helpers/spree/admin/base_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Spree::Admin::BaseHelper, type: :helper do +RSpec.describe Spree::Admin::BaseHelper do helper 'spree/admin/navigation' describe "#link_to_remove_fields" do diff --git a/spec/helpers/spree/admin/general_settings_helper_spec.rb b/spec/helpers/spree/admin/general_settings_helper_spec.rb index c5713c6dec..877578e39d 100644 --- a/spec/helpers/spree/admin/general_settings_helper_spec.rb +++ b/spec/helpers/spree/admin/general_settings_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Spree::Admin::GeneralSettingsHelper, type: :helper do +RSpec.describe Spree::Admin::GeneralSettingsHelper do describe "#all_units" do it "returns all units" do expect(helper.all_units).to eq(["mg", "g", "kg", "T", "oz", "lb", "mL", "cL", "dL", "L", diff --git a/spec/helpers/spree/admin/orders_helper_spec.rb b/spec/helpers/spree/admin/orders_helper_spec.rb index 80e93996e1..6b047774fa 100644 --- a/spec/helpers/spree/admin/orders_helper_spec.rb +++ b/spec/helpers/spree/admin/orders_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Spree::Admin::OrdersHelper, type: :helper do +RSpec.describe Spree::Admin::OrdersHelper do describe "#orders_links" do let(:order) { double(:order) } let(:distributor) { double(:enterprise) } diff --git a/spec/helpers/spree/orders_helper_spec.rb b/spec/helpers/spree/orders_helper_spec.rb index a74ce38e9e..dc384e2a7a 100644 --- a/spec/helpers/spree/orders_helper_spec.rb +++ b/spec/helpers/spree/orders_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Spree::OrdersHelper, type: :helper do +RSpec.describe Spree::OrdersHelper do describe "#changeable_orders" do let(:complete_orders) { double(:complete_orders, where: "some_orders") } diff --git a/spec/helpers/tax_helper_spec.rb b/spec/helpers/tax_helper_spec.rb index 2d262d8486..0b9ad20e98 100644 --- a/spec/helpers/tax_helper_spec.rb +++ b/spec/helpers/tax_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TaxHelper, type: :helper do +RSpec.describe TaxHelper do let(:line_item) { create(:line_item) } let(:line_item2) { create(:line_item) } let(:line_item3) { create(:line_item) } diff --git a/spec/helpers/terms_and_conditions_helper_spec.rb b/spec/helpers/terms_and_conditions_helper_spec.rb index 100fc3e80d..a62e6aa049 100644 --- a/spec/helpers/terms_and_conditions_helper_spec.rb +++ b/spec/helpers/terms_and_conditions_helper_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe TermsAndConditionsHelper, type: :helper do +RSpec.describe TermsAndConditionsHelper do describe "#platform_terms_required?" do context 'when ToS file is present' do before do