Sha256: c0907921be6d2acfd1b847cb2e06e6551990ad723630cc7da6564ea533296f3c

Contents?: true

Size: 1.12 KB

Versions: 23

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe_example 'embeds_many/simple' do
  it 'parses first embedded item' do
    root.items[0].id.should == 2000
  end

  it 'parses second embedded item' do
    root.items[1].id.should == 2001
  end
end


describe_example 'embeds_many/invisible' do
  it 'parses invisible item correctly' do
    root.locale.should == 'pt-BR'
  end

  it "doesn't show embedded items in resource" do
    root.resource.should_not have_key('locale')
  end
end

describe_example 'embeds_many/with_class_name' do
  it 'parses embedded item' do
    root.items[0].id.should == 2000
  end
end

describe_example 'embeds_many/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_items.items.first.id.should == "2000"
      end
    end

    context 'and it evaluates to false' do
      it "doesn't parse embedded item" do
        root_without_items.items.should_not be
      end
    end
  end
end

describe_example 'embeds_many/with_start_key' do
  it 'parses embedded items' do
    root.items.first.id.should == "2000"
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
transcriber-0.0.26 spec/integration/embeds_many_spec.rb
transcriber-0.0.25 spec/integration/embeds_many_spec.rb
transcriber-0.0.24 spec/integration/embeds_many_spec.rb
transcriber-0.0.23 spec/integration/embeds_many_spec.rb
transcriber-0.0.22 spec/integration/embeds_many_spec.rb
transcriber-0.0.21 spec/integration/embeds_many_spec.rb
transcriber-0.0.20 spec/integration/embeds_many_spec.rb
transcriber-0.0.19 spec/integration/embeds_many_spec.rb
transcriber-0.0.18 spec/integration/embeds_many_spec.rb
transcriber-0.0.17 spec/integration/embeds_many_spec.rb
transcriber-0.0.16 spec/integration/embeds_many_spec.rb
transcriber-0.0.15 spec/integration/embeds_many_spec.rb
transcriber-0.0.14 spec/integration/embeds_many_spec.rb
transcriber-0.0.13 spec/integration/embeds_many_spec.rb
transcriber-0.0.12 spec/integration/embeds_many_spec.rb
transcriber-0.0.11 spec/integration/embeds_many_spec.rb
transcriber-0.0.10 spec/integration/embeds_many_spec.rb
transcriber-0.0.9 spec/integration/embeds_many_spec.rb
transcriber-0.0.8 spec/integration/embeds_many_spec.rb
transcriber-0.0.7 spec/integration/embeds_many_spec.rb