Sha256: 9350fd6e0a6fb2a81b0c330caf05d1b3b341f9e19b4d4370d6c8b9070593bab6

Contents?: true

Size: 767 Bytes

Versions: 14

Compression:

Stored size: 767 Bytes

Contents

require 'spec_helper'

describe Ardm::Property::Text do
  let(:name)          { :title }
  let(:type)          { described_class }
  let(:options)       { {} }
  let(:value)         { 'value' }
  let(:other_value)   { 'return value' }
  let(:invalid_value) { 1 }
  let(:model) { Blog::Article }
  let(:property) { type.new(model, name, options) }

  it_should_behave_like 'A semipublic Property'

  describe '#load' do
    before do
      @value = 'value'
    end

    subject { property.load(@value) }

    let(:property) { type.new(model, name) }

    it 'should delegate to #type.load' do
      return_value = 'return value'
      expect(property).to receive(:load).with(@value).and_return(return_value)
      expect(subject).to eq(return_value)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ardm-0.4.0.ar427 spec/semipublic/property/text_spec.rb
ardm-0.4.0 spec/semipublic/property/text_spec.rb
ardm-0.3.2 spec/semipublic/property/text_spec.rb
ardm-0.3.1 spec/semipublic/property/text_spec.rb
ardm-0.3.0 spec/semipublic/property/text_spec.rb
ardm-0.2.7 spec/semipublic/property/text_spec.rb
ardm-0.2.6 spec/semipublic/property/text_spec.rb
ardm-0.2.5 spec/semipublic/property/text_spec.rb
ardm-0.2.4 spec/semipublic/property/text_spec.rb
ardm-0.2.3 spec/semipublic/property/text_spec.rb
ardm-0.2.2 spec/semipublic/property/text_spec.rb
ardm-0.2.1 spec/semipublic/property/text_spec.rb
ardm-0.2.0 spec/semipublic/property/text_spec.rb
ardm-0.1.0 spec/semipublic/property/text_spec.rb