Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Pickup Object in Shipment's create parameters. (#56)
Browse files Browse the repository at this point in the history
Adds pickup attribute to shipment object

[ch4739](https://app.clubhouse.io/shipcloud/story/4739)
  • Loading branch information
mariiillo authored Jul 28, 2020
1 parent 6991edd commit b78bfd9
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions spec/shipcloud/shipment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@
width: 20,
height: 20
},
pickup: {
pickup_time: {
earliest: "2015-09-15T09:00:00+02:00",
latest: "2015-09-15T18:00:00+02:00"
},
pickup_address: {
company: "Sender Ltd.",
first_name: "Jane",
last_name: "Doe",
street: "Musterstraße",
street_no: "42",
zip_code: "54321",
city: "Musterstadt",
country: "DE"
},
},
metadata: {
product: {
name: "foo"
Expand All @@ -32,12 +48,6 @@
id: "123456",
contents_type: "commercial_goods",
},
pickup: {
pickup_time: {
earliest: "2020-07-24T13:59:58+23:57",
latest: "2020-07-24T18:59:58+23:57",
}
}
}
end

Expand All @@ -62,10 +72,19 @@
expect(shipment.package[:width]).to eq 20
expect(shipment.package[:height]).to eq 20

expect(shipment.pickup[:pickup_time][:earliest]).to eq "2015-09-15T09:00:00+02:00"
expect(shipment.pickup[:pickup_time][:latest]).to eq "2015-09-15T18:00:00+02:00"
expect(shipment.pickup[:pickup_address][:company]).to eq "Sender Ltd."
expect(shipment.pickup[:pickup_address][:first_name]).to eq "Jane"
expect(shipment.pickup[:pickup_address][:last_name]).to eq "Doe"
expect(shipment.pickup[:pickup_address][:street]).to eq "Musterstraße"
expect(shipment.pickup[:pickup_address][:street_no]).to eq "42"
expect(shipment.pickup[:pickup_address][:zip_code]).to eq "54321"
expect(shipment.pickup[:pickup_address][:city]).to eq "Musterstadt"
expect(shipment.pickup[:pickup_address][:country]).to eq "DE"

expect(shipment.customs_declaration[:id]).to eq "123456"
expect(shipment.customs_declaration[:contents_type]).to eq "commercial_goods"
expect(shipment.pickup[:pickup_time][:earliest]).to eq "2020-07-24T13:59:58+23:57"
expect(shipment.pickup[:pickup_time][:latest]).to eq "2020-07-24T18:59:58+23:57"
end

it "initializes the metadata correctly" do
Expand Down

0 comments on commit b78bfd9

Please sign in to comment.