diff --git a/lib/sly/interface.rb b/lib/sly/interface.rb index d7197f6..accb79f 100644 --- a/lib/sly/interface.rb +++ b/lib/sly/interface.rb @@ -57,8 +57,9 @@ def update_item(id, attributes) item_hash = item.to_flat_hash - #can't change type of item + #can't change type or product of item item_hash.delete(:type) + item_hash.delete(:product) self.connector.update_item(id, item_hash) end diff --git a/spec/sly/interface_spec.rb b/spec/sly/interface_spec.rb index 1e2cff4..a748c5e 100644 --- a/spec/sly/interface_spec.rb +++ b/spec/sly/interface_spec.rb @@ -128,14 +128,15 @@ }) end - it "does not try to update the type" do + it "does not try to update the type or product" do expect(api.connector).to receive(:update_item).with(id, { number: id, score: "S", tags: "tag1,tag2" }) api.update_item(id, { - type: "story" + type: "story", + product: Sly::Product.new }) end