From b04be5fd9b284f2169b6dd3f57a3626dd7b9fec6 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Fri, 14 Jul 2023 15:32:44 +1000 Subject: [PATCH] Fix Rubocop warning --- spec/models/vouchers/flat_rate_spec.rb | 8 ++++---- spec/models/vouchers/percentage_rate_spec.rb | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/models/vouchers/flat_rate_spec.rb b/spec/models/vouchers/flat_rate_spec.rb index f6d05eec51e3..3860410cfb9c 100644 --- a/spec/models/vouchers/flat_rate_spec.rb +++ b/spec/models/vouchers/flat_rate_spec.rb @@ -6,7 +6,7 @@ let(:enterprise) { build(:enterprise) } describe 'validations' do - subject { build(:voucher_flat_rate, code: 'new_code', enterprise: enterprise) } + subject { build(:voucher_flat_rate, code: 'new_code', enterprise:) } it { is_expected.to validate_presence_of(:amount) } it { is_expected.to validate_numericality_of(:amount).is_greater_than(0) } @@ -16,7 +16,7 @@ let(:order) { create(:order_with_totals) } context 'when order total is more than the voucher' do - subject { create(:voucher_flat_rate, code: 'new_code', enterprise: enterprise, amount: 5) } + subject { create(:voucher_flat_rate, code: 'new_code', enterprise:, amount: 5) } it 'uses the voucher total' do expect(subject.compute_amount(order).to_f).to eq(-5) @@ -24,7 +24,7 @@ end context 'when order total is less than the voucher' do - subject { create(:voucher_flat_rate, code: 'new_code', enterprise: enterprise, amount: 20) } + subject { create(:voucher_flat_rate, code: 'new_code', enterprise:, amount: 20) } it 'matches the order total' do expect(subject.compute_amount(order).to_f).to eq(-10) @@ -34,7 +34,7 @@ describe "#rate" do subject do - create(:voucher_flat_rate, code: 'new_code', enterprise: enterprise, amount: 5) + create(:voucher_flat_rate, code: 'new_code', enterprise:, amount: 5) end let(:order) { create(:order_with_totals) } diff --git a/spec/models/vouchers/percentage_rate_spec.rb b/spec/models/vouchers/percentage_rate_spec.rb index 01bd7c1e767b..e59be0fed1af 100644 --- a/spec/models/vouchers/percentage_rate_spec.rb +++ b/spec/models/vouchers/percentage_rate_spec.rb @@ -6,7 +6,7 @@ let(:enterprise) { build(:enterprise) } describe 'validations' do - subject { build(:voucher_percentage_rate, code: 'new_code', enterprise: enterprise) } + subject { build(:voucher_percentage_rate, code: 'new_code', enterprise:) } it { is_expected.to validate_presence_of(:amount) } it do @@ -18,7 +18,7 @@ describe '#compute_amount' do subject do - create(:voucher_percentage_rate, code: 'new_code', enterprise: enterprise, amount: 10) + create(:voucher_percentage_rate, code: 'new_code', enterprise:, amount: 10) end let(:order) { create(:order_with_totals) } @@ -29,7 +29,7 @@ describe "#rate" do subject do - create(:voucher_percentage_rate, code: 'new_code', enterprise: enterprise, amount: 50) + create(:voucher_percentage_rate, code: 'new_code', enterprise:, amount: 50) end it "returns the voucher percentage rate" do