# frozen_string_literal: true

require 'spec_helper'

describe Spree::Asset do
  describe "#viewable" do
    it "touches association" do
      product = create(:custom_product)
      asset = Spree::Asset.create! { |a| a.viewable = product.master }

      product.update_column(:updated_at, 1.day.ago)

      expect do
        asset.touch
      end.to change { product.reload.updated_at }
    end
  end
end

# frozen_string_literal: true

require 'spec_helper'

describe Spree::Asset do
  describe "#viewable" do
    it "touches association" do
      product = create(:product)
      asset = Spree::Asset.create! { |a| a.viewable = product.master }

      product.update_column(:updated_at, 1.day.ago)

      expect do
        asset.touch
      end.to change { product.reload.updated_at }
    end
  end
end

Use existing product factory, the custom product is not needed here
Use existing product factory, the custom product is not needed here
