File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ Layout/SpaceInsideParens:
113113# EnforcedStyle: single_quotes
114114
115115# Detect hard tabs, no hard tabs.
116- Layout/Tab :
116+ Layout/IndentationStyle :
117117 Enabled : true
118118
119119# Blank lines should not have any spaces.
Original file line number Diff line number Diff line change 11RSpec . describe 'Estimates Integration' do
2- it 'supports create, retrieve and list' do
3- # Configure the Patch gem
2+ before do
43 Patch . configure do |config |
54 config . access_token = ENV [ 'PATCH_RUBY_API_KEY' ]
65 end
6+ end
77
8+ it 'supports create, retrieve and list' do
89 create_estimate_response = Patch ::Estimate . create_mass_estimate ( mass_g : 100 )
910 estimate_id = create_estimate_response . data . id
1011
2324
2425 expect ( estimates . length ) . not_to be_zero
2526 end
27+
28+ it 'supports create with a project-id' do
29+ retrieve_projects_response = Patch ::Project . retrieve_projects ( page : 1 )
30+ project_id = retrieve_projects_response . data . first . id
31+ create_estimate_response = Patch ::Estimate . create_mass_estimate ( mass_g : 100 , project_id : project_id )
32+ estimate_id = create_estimate_response . data . id
33+
34+ expect ( create_estimate_response . success ) . to eq true
35+ expect ( create_estimate_response . data . order . id ) . not_to be_nil
36+ expect ( create_estimate_response . data . order . mass_g ) . to eq ( 100 )
37+ end
2638end
Original file line number Diff line number Diff line change 2525 expect ( orders . length ) . not_to be_zero
2626 end
2727
28+ it 'supports create with a project-id' do
29+ retrieve_projects_response = Patch ::Project . retrieve_projects ( page : 1 )
30+ project_id = retrieve_projects_response . data . first . id
31+
32+ create_order_response = Patch ::Order . create_order ( mass_g : 100 , project_id : project_id )
33+
34+ expect ( create_order_response . success ) . to eq true
35+ expect ( create_order_response . data . id ) . not_to be_nil
36+ expect ( create_order_response . data . mass_g ) . to eq ( 100 )
37+ end
38+
39+ it 'supports create with metadata' do
40+ metadata = { user : 'john doe' }
41+
42+ create_order_response = Patch ::Order . create_order ( mass_g : 100 , metadata : metadata )
43+
44+ expect ( create_order_response . success ) . to eq true
45+ expect ( create_order_response . data . id ) . not_to be_nil
46+ expect ( create_order_response . data . mass_g ) . to eq ( 100 )
47+ expect ( create_order_response . data . metadata ) . to eq ( metadata )
48+ end
49+
2850 it 'supports place and cancel for orders created via an estimate' do
2951 create_estimate_to_place_response = Patch ::Estimate . create_mass_estimate ( mass_g : 100 )
3052 order_to_place_id = create_estimate_to_place_response . data . order . id
You can’t perform that action at this time.
0 commit comments