Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
…braintree into respect_state_config
  • Loading branch information
digitalWestie committed Jul 15, 2019
2 parents e80e0b8 + e400a4e commit 7371671
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/spree/store_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
private

def build_default_configuration
build_braintree_configuration
build_braintree_configuration unless braintree_configuration
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<% end %>

<% if current_store.braintree_configuration.apple_pay? %>
<%= render "spree/shared/apple_pay_button" %>
<%= render "spree/shared/apple_pay_button", id: id %>
<% end %>

<%= render "spree/shared/braintree_errors" %>
14 changes: 14 additions & 0 deletions spec/models/spree/store_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'spec_helper'

describe Spree::Store do
describe 'before_create :build_default_configuration' do
context 'when a braintree_configuration record already exists' do
it 'does not overwrite it' do
store = build(:store)
custom_braintree_configuration = store.build_braintree_configuration
store.save!
expect(store.braintree_configuration).to be custom_braintree_configuration
end
end
end
end

0 comments on commit 7371671

Please sign in to comment.