Sha256: 0679a411df6a2e50a6a50688fe0fa9733a4cabebc6f32cba5b47e71a0a7474dd

Contents?: true

Size: 823 Bytes

Versions: 60

Compression:

Stored size: 823 Bytes

Contents

RSpec::Matchers.define :have_record_ref do |attribute|

  match do |model|
    record_ref_can_be_set_and_retrieved?(model, attribute) && record_ref_can_be_set_on_instantiation?(model, attribute)
  end

  def record_ref_can_be_set_and_retrieved?(model, attribute)
    model.send("#{attribute}=".to_sym, attributes)
    expect(model.send(attribute)).to be_kind_of(NetSuite::Records::RecordRef)
  end

  def record_ref_can_be_set_on_instantiation?(model, attribute)
    new_model = model.class.new(attribute => attributes)
    expect(new_model.send(attribute)).to be_kind_of(NetSuite::Records::RecordRef)
  end

  def attributes
    {
      :@internal_id           => '125',
      :"@xmlns:platform_core" => 'urn:core_2011_2.platform.webservices.netsuite.com',
      :name                   => 'RP RecordRef'
    }
  end

end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
netsuite-0.5.6 spec/support/record_ref_matcher.rb
netsuite-0.5.5 spec/support/record_ref_matcher.rb
netsuite-0.5.4 spec/support/record_ref_matcher.rb
netsuite-0.5.3 spec/support/record_ref_matcher.rb
netsuite-0.5.2 spec/support/record_ref_matcher.rb
netsuite-0.5.1 spec/support/record_ref_matcher.rb
netsuite-0.5.0 spec/support/record_ref_matcher.rb
netsuite-0.4.9 spec/support/record_ref_matcher.rb
netsuite-0.4.8 spec/support/record_ref_matcher.rb
netsuite-0.4.7 spec/support/record_ref_matcher.rb
netsuite-0.4.6 spec/support/record_ref_matcher.rb
netsuite-0.4.5 spec/support/record_ref_matcher.rb
netsuite-0.4.4 spec/support/record_ref_matcher.rb
netsuite-0.4.3 spec/support/record_ref_matcher.rb
netsuite-0.4.2 spec/support/record_ref_matcher.rb
netsuite-0.4.1 spec/support/record_ref_matcher.rb
netsuite-0.4.0 spec/support/record_ref_matcher.rb
netsuite-0.3.3 spec/support/record_ref_matcher.rb
netsuite-0.3.2 spec/support/record_ref_matcher.rb
netsuite-0.3.1 spec/support/record_ref_matcher.rb