Sha256: e0571ba143df85a442a1694a2a52aed1848bd561684b5ba3f5f9364fe4765c19

Contents?: true

Size: 1.54 KB

Versions: 23

Compression:

Stored size: 1.54 KB

Contents

require 'spec_helper'

def it_parses_property
  it 'parses property' do
    root.login.should == 'jackiechan2010'
  end
end

describe_example 'properties/simple' do
  it_parses_property
end

describe_example 'properties/with_field' do
  context 'when input has a different name for the property' do
    it_parses_property
  end
end

describe_example 'properties/with_field_path' do
  context 'when input has a different path for the property' do
    it_parses_property
  end
end

describe_example 'properties/with_id' do
  context 'when property is an id' do
    it 'parses id' do
      root.id.should == "2000"
    end
  end
end

describe_example 'properties/with_if' do
  context 'when a property has a conditional proc (:if)' do
    context 'and it evaluates to true' do
      it 'parses property' do
        root_with_description.description.should == "description"
      end
    end

    context 'and it evaluates to false' do
      it "doesn't parse property" do
        root_without_description.description.should_not be
      end
    end
  end
end

describe_example 'properties/with_key_converter' do
  after do
    Transcriber.configure do |c|
      c.convert_input_keys = nil
    end
  end

  context 'when a diferent key converter is configured on transcriber' do
    it_parses_property
  end
end

describe_example 'properties/with_two_key_converters' do
  context 'when key converters are configured for each class' do
    it_parses_property

    it 'parses other property with different key converter' do
      root.product.unit_price.should == 29.9
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

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