Sha256: 0b3b3a894523a29af2a55f1e85cab22831c02b6a3fbc6609587669e84e4def4f

Contents?: true

Size: 628 Bytes

Versions: 8

Compression:

Stored size: 628 Bytes

Contents

require 'test_helper'

module PushType
  class AssetFieldTest < ActiveSupport::TestCase

    class TestPage < PushType::Node
      field :foo_id, :asset
    end

    let(:node)  { TestPage.create FactoryGirl.attributes_for(:node, foo_id: asset.id) }
    let(:asset) { FactoryGirl.create :asset }
    let(:field) { node.fields[:foo_id] }
    
    it { field.template.must_equal 'asset' }
    it { field.relation_class.must_equal PushType::Asset }
    it { field.json_value.must_equal asset.id }
    it { field.value.must_equal asset.id }

    it { node.foo_id.must_equal asset.id }
    it { node.foo.must_equal asset }

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
push_type_core-0.8.0.beta.2 test/fields/push_type/asset_field_test.rb
push_type_core-0.8.0.beta.1 test/fields/push_type/asset_field_test.rb
push_type_core-0.7.0 test/fields/push_type/asset_field_test.rb
push_type_core-0.7.0.beta.1 test/fields/push_type/asset_field_test.rb
push_type_core-0.6.0 test/fields/push_type/asset_field_test.rb
push_type_core-0.6.0.beta.4 test/fields/push_type/asset_field_test.rb
push_type_core-0.6.0.beta.3 test/fields/push_type/asset_field_test.rb
push_type_core-0.6.0.beta.2 test/fields/push_type/asset_field_test.rb