File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 47
47
expect ( create_order_response . data . patch_fee_cents_usd ) . not_to be_empty
48
48
end
49
49
50
+ it 'supports create with a total price' do
51
+ retrieve_project_response = Patch ::Project . retrieve_project (
52
+ Constants ::BIOMASS_TEST_PROJECT_ID
53
+ )
54
+
55
+ project_id = retrieve_project_response . data . id
56
+ total_price_cents_usd = 5_00
57
+
58
+ create_order_response = Patch ::Order . create_order (
59
+ total_price_cents_usd : total_price_cents_usd ,
60
+ project_id : project_id
61
+ )
62
+
63
+ expect ( create_order_response . success ) . to eq true
64
+
65
+ order = create_order_response . data
66
+
67
+ expect ( order . id ) . not_to be_nil
68
+ expect ( order . mass_g ) . to eq ( 1_250_000 )
69
+ expect ( order . price_cents_usd . to_i ) . to eq ( 125 )
70
+ expect ( order . patch_fee_cents_usd . to_i ) . to eq ( 375 )
71
+ expect (
72
+ order . price_cents_usd . to_i + order . patch_fee_cents_usd . to_i
73
+ ) . to eq ( total_price_cents_usd )
74
+ end
75
+
50
76
it 'supports create with metadata' do
51
77
metadata = { user : 'john doe' }
52
78
You can’t perform that action at this time.
0 commit comments