Sha256: c51be7bd68ce3d7bab4901a48a5426781e50c34e9d93050fb16b122bdd6040b1

Contents?: true

Size: 581 Bytes

Versions: 16

Compression:

Stored size: 581 Bytes

Contents

require 'spec_helper'

describe Spree::OptionValue, type: :model do
  describe 'delegate' do
    it { is_expected.to delegate_method(:name).to(:option_type).with_prefix }
    it { is_expected.to delegate_method(:presentation).to(:option_type).with_prefix }
  end

  context "touching" do
    it "should touch a variant" do
      variant = create(:variant)
      option_value = variant.option_values.first
      variant.update_column(:updated_at, 1.day.ago)
      option_value.touch
      expect(variant.reload.updated_at).to be_within(3.seconds).of(Time.current)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spree_core-3.3.0.rc1 spec/models/spree/option_value_spec.rb
spree_core-3.1.5 spec/models/spree/option_value_spec.rb
spree_core-3.2.1 spec/models/spree/option_value_spec.rb
spree_core-3.2.0 spec/models/spree/option_value_spec.rb
spree_core-3.1.4 spec/models/spree/option_value_spec.rb
spree_core-3.2.0.rc3 spec/models/spree/option_value_spec.rb
spree_core-3.2.0.rc2 spec/models/spree/option_value_spec.rb
spree_core-3.2.0.rc1 spec/models/spree/option_value_spec.rb
spree_core-3.1.3 spec/models/spree/option_value_spec.rb
spree_core-3.1.2 spec/models/spree/option_value_spec.rb
spree_core-3.1.1 spec/models/spree/option_value_spec.rb
spree_core-3.1.0 spec/models/spree/option_value_spec.rb
spree_core-3.1.0.rc4 spec/models/spree/option_value_spec.rb
spree_core-3.1.0.rc3 spec/models/spree/option_value_spec.rb
spree_core-3.1.0.rc2 spec/models/spree/option_value_spec.rb
spree_core-3.1.0.rc1 spec/models/spree/option_value_spec.rb