Sha256: e35d1f6edcf279e8a0f619f4726b682e12b73ce6abc7ca3e82dd4810d895b2b8

Contents?: true

Size: 734 Bytes

Versions: 26

Compression:

Stored size: 734 Bytes

Contents

require "spec_helper"

describe DataMapper::Property::ParsePointer do
  subject { property }
  let(:property) { Comment.properties[:article_id] }

  describe "#dump" do
    subject { property.dump value }
    let(:value) { "xxx" }

    it { should eq("__type" => "Pointer", "className" => Article.storage_name, "objectId" => "xxx") }

    context "when value is nil" do
      let(:value) { nil }

      it { should be_nil }
    end
  end

  describe "#load" do
    subject { property.load value }
    let(:value) { {"__type" => "Pointer", "className" => Article.storage_name, "objectId" => "xxx"} }

    it { should eq("xxx") }
  end

  describe "#valid?" do
    subject { property.valid? "xxx" }

    it { should be_true }
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
dm-parse-0.3.20 spec/parse_pointer_spec.rb
dm-parse-0.3.19 spec/parse_pointer_spec.rb
dm-parse-0.3.18 spec/parse_pointer_spec.rb
dm-parse-0.3.17 spec/parse_pointer_spec.rb
dm-parse-0.3.16 spec/parse_pointer_spec.rb
dm-parse-0.3.15 spec/parse_pointer_spec.rb
dm-parse-0.3.14 spec/parse_pointer_spec.rb
dm-parse-0.3.13 spec/parse_pointer_spec.rb
dm-parse-0.3.12 spec/parse_pointer_spec.rb
dm-parse-0.3.11 spec/parse_pointer_spec.rb
dm-parse-0.3.10 spec/parse_pointer_spec.rb
dm-parse-0.3.9 spec/parse_pointer_spec.rb
dm-parse-0.3.8 spec/parse_pointer_spec.rb
dm-parse-0.3.7 spec/parse_pointer_spec.rb
dm-parse-0.3.6 spec/parse_pointer_spec.rb
dm-parse-0.3.5 spec/parse_pointer_spec.rb
dm-parse-0.3.4 spec/parse_pointer_spec.rb
dm-parse-0.3.3 spec/parse_pointer_spec.rb
dm-parse-0.3.2 spec/parse_pointer_spec.rb
dm-parse-0.3.1 spec/parse_pointer_spec.rb