Sha256: c8afb8e41e1b9e265d917eb0366b90d3534f912e8845d72a2e2382c536fc449f

Contents?: true

Size: 1.23 KB

Versions: 28

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe "embeds_one" do
  describe_example "embeds_one/simple" do
    it 'parses embedded item' do
      @root.item.id.should == "2000"
    end
  end

  describe_example "embeds_one/flattened" do
    it "parses flattened key" do
      @root.item.id.should == "2000"
    end
  end

  describe_example "embeds_one/with_class_name" do
    context 'when a different class name is used for embeddable' do
      it 'parses embedded item' do
        @root.item.id.should == "2000"
      end
    end
  end

  describe_example "embeds_one/with_if" do
    context 'when an embeddable has a conditional proc (:if)' do
      context 'and it evaluates to true' do
        it 'parses embedded item' do
          @root_with_item.id.should == "1"
          @root_with_item.item.id.should == "2000"
        end
      end

      context 'and it evaluates to false' do
        it "doesn't parse embedded item" do
          @root_without_item.id.should == "100"
          @root_without_item.item.should_not be
        end
      end
    end
  end

  describe_example "embeds_one/with_start_key" do
    context 'when there is a start key to parse input' do
      it 'parses embedded item' do
        @root.item.id.should == "2000"
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rest_model-0.3.1 spec/integration/embeds_one_spec.rb
rest_model-0.3.0 spec/integration/embeds_one_spec.rb
rest_model-0.2.3 spec/integration/embeds_one_spec.rb
rest_model-0.2.1 spec/integration/embeds_one_spec.rb
rest_model-0.2.0 spec/integration/embeds_one_spec.rb
rest_model-0.1.24 spec/integration/embeds_one_spec.rb
rest_model-0.1.23 spec/integration/embeds_one_spec.rb
rest_model-0.1.22 spec/integration/embeds_one_spec.rb
rest_model-0.1.21 spec/integration/embeds_one_spec.rb
rest_model-0.1.20 spec/integration/embeds_one_spec.rb
rest_model-0.1.19 spec/integration/embeds_one_spec.rb
rest_model-0.1.18 spec/integration/embeds_one_spec.rb
rest_model-0.1.17 spec/integration/embeds_one_spec.rb
rest_model-0.1.16 spec/integration/embeds_one_spec.rb
rest_model-0.1.15 spec/integration/embeds_one_spec.rb
rest_model-0.1.14 spec/integration/embeds_one_spec.rb
rest_model-0.1.13 spec/integration/embeds_one_spec.rb
rest_model-0.1.12 spec/integration/embeds_one_spec.rb
rest_model-0.1.11 spec/integration/embeds_one_spec.rb
rest_model-0.1.10 spec/integration/embeds_one_spec.rb