Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge with active merchant option name for test #319

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/models/spree/gateway/paymill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ class Gateway::Paymill < Gateway
def provider_class
ActiveMerchant::Billing::PaymillGateway
end

def options
super().merge(:test => self.preferred_test_mode)
end

end
end
13 changes: 13 additions & 0 deletions spec/models/gateway/paymill_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,17 @@
expect(gateway.provider_class).to eq ::ActiveMerchant::Billing::PaymillGateway
end
end

describe 'options' do
it 'include :test => true in when :test_mode is true' do
gateway.preferred_test_mode = true
expect(gateway.options[:test]).to be true
end

it 'does not include :test when test_mode is false' do
gateway.preferred_test_mode = false
expect(gateway.options[:test]).to be false
end
end

end