Fix offense constant definition in block in models/spree/gateway_spec.rb

This commit is contained in:
Ana Nunes da Silva
2024-03-26 10:57:32 +00:00
parent 3bd6c85f3b
commit fc3d7f8496
2 changed files with 9 additions and 10 deletions

View File

@@ -11,7 +11,6 @@
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/models/spree/gateway_spec.rb'
- 'spec/models/spree/preferences/configuration_spec.rb'
- 'spec/models/spree/preferences/preferable_spec.rb'
- 'spec/validators/date_time_string_validator_spec.rb'

View File

@@ -3,20 +3,20 @@
require 'spec_helper'
describe Spree::Gateway do
class Provider
def initialize(options); end
let(:test_gateway) do
Class.new(Spree::Gateway) do
def provider_class
Class.new do
def initialize(options = {}); end
def imaginary_method; end
end
class TestGateway < Spree::Gateway
def provider_class
Provider
def imaginary_method; end
end
end
end
end
it "passes through all arguments on a method_missing call" do
gateway = TestGateway.new
gateway = test_gateway.new
expect(gateway.provider).to receive(:imaginary_method).with('foo')
gateway.imaginary_method('foo')
end