Sha256: 125969ad692e32bff7be471280f22aea26a35a7dd7670b777a9db51d2a12b1ea
Contents?: true
Size: 761 Bytes
Versions: 8
Compression:
Stored size: 761 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 } describe 'with missing relations' do before do asset.destroy end it { node.foo.must_be_nil } end end end
Version data entries
8 entries across 8 versions & 1 rubygems