Skip to content

Commit

Permalink
Drop Spree_services/product.rb ..
Browse files Browse the repository at this point in the history
Cant really see a reason for having this file here. Less code to
maintain
  • Loading branch information
huoxito committed Oct 24, 2014
1 parent 32ad8ab commit 11d73f9
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 33 deletions.
4 changes: 0 additions & 4 deletions lib/Spree_services/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ def upsert_order!
Integration::Order.new(config, payload).upsert!
end

def upsert_product!
Integration::Product.new(config, payload[service_name]).upsert!
end

def handle_returns!
Integration::Return.new(config, payload[service_name]).handle_all!
end
Expand Down
8 changes: 0 additions & 8 deletions lib/Spree_services/product.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/salesforce_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require 'Spree_services/base'
require 'Spree_services/order'
require 'Spree_services/customer'
require 'Spree_services/product'
require 'Spree_services/line_item'
require 'Spree_services/payment'
require 'Spree_services/return'
Expand Down
2 changes: 1 addition & 1 deletion salesforce_endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SalesforceEndpoint < EndpointBase::Sinatra::Base
['/add_product', '/update_product'].each do |path|
post path do
begin
SpreeService::Product.new(@payload, @config).upsert_product!
Integration::Product.new(@config, @payload[:product]).upsert!
set_summary "Product #{@payload["product"]["id"]} updated (or created) in Salesforce"
result 200
rescue Exception => e
Expand Down
7 changes: 0 additions & 7 deletions spec/lib/Spree_services/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,5 @@
subject.upsert_order!
end
end

describe '#upsert_product!' do
it 'creates an product integration and calls upsert! on it' do
expect_any_instance_of(Integration::Product).to receive(:upsert!).once
subject.upsert_product!
end
end
end
end
12 changes: 0 additions & 12 deletions spec/lib/Spree_services/product_spec.rb

This file was deleted.

0 comments on commit 11d73f9

Please sign in to comment.