mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
Fix offense constant definition in block in models/spree/gateway_spec.rb
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user