Sha256: 063d52f71dfbd67470fb2387a87ba2242e2ffb4ba9c1ecf1bd6b108fc9a00665

Contents?: true

Size: 786 Bytes

Versions: 7

Compression:

Stored size: 786 Bytes

Contents

require 'test_helper'

class Gecko::FulfillmentTest < Minitest::Test
  include VCRHelper
  include SharedRecordExamples

  let(:plural_name)   { 'fulfillments' }
  let(:record_class)  { Gecko::Record::Fulfillment }

  def setup
    @json   = load_vcr_hash('fulfillments', 'fulfillments').first
    @record = record_class.new(client, @json)
  end

  def test_initializes_record
    assert_instance_of(Gecko::Record::Fulfillment, @record)
  end

  def test_serialization
    json_keys = %w(
      order_id shipping_address_id billing_address_id status exchange_rate
      delivery_type tracking_number notes tracking_url tracking_company packed_at
      shipped_at received_at receipt
    ).map(&:to_sym)
    assert_equal json_keys.sort, @record.as_json[:fulfillment].keys.sort
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gecko-ruby-0.0.10 test/record/fulfillment_test.rb
gecko-ruby-0.0.9 test/record/fulfillment_test.rb
gecko-ruby-0.0.8 test/record/fulfillment_test.rb
gecko-ruby-0.0.7 test/record/fulfillment_test.rb
gecko-ruby-0.0.6 test/record/fulfillment_test.rb
gecko-ruby-0.0.5 test/record/fulfillment_test.rb
gecko-ruby-0.0.4 test/record/fulfillment_test.rb