netsuite 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/README.md +1 -1
  2. data/lib/netsuite.rb +0 -1
  3. data/lib/netsuite/actions/search.rb +5 -0
  4. data/lib/netsuite/records/file.rb +3 -8
  5. data/lib/netsuite/support/country.rb +2 -2
  6. data/lib/netsuite/version.rb +1 -1
  7. data/netsuite.gemspec +1 -1
  8. data/spec/netsuite/actions/add_spec.rb +14 -14
  9. data/spec/netsuite/actions/delete_spec.rb +2 -2
  10. data/spec/netsuite/actions/get_spec.rb +3 -3
  11. data/spec/netsuite/actions/initialize_spec.rb +2 -2
  12. data/spec/netsuite/actions/search_spec.rb +6 -6
  13. data/spec/netsuite/actions/update_spec.rb +16 -16
  14. data/spec/netsuite/actions/upsert_list_spec.rb +4 -4
  15. data/spec/netsuite/actions/upsert_spec.rb +14 -14
  16. data/spec/netsuite/configuration_spec.rb +21 -21
  17. data/spec/netsuite/records/account_spec.rb +16 -16
  18. data/spec/netsuite/records/accounting_period_spec.rb +16 -16
  19. data/spec/netsuite/records/assembly_item_spec.rb +2 -2
  20. data/spec/netsuite/records/bill_address_spec.rb +3 -3
  21. data/spec/netsuite/records/billing_schedule_milestone_list_spec.rb +4 -4
  22. data/spec/netsuite/records/billing_schedule_milestone_spec.rb +6 -6
  23. data/spec/netsuite/records/billing_schedule_recurrence_list_spec.rb +4 -4
  24. data/spec/netsuite/records/billing_schedule_recurrence_spec.rb +6 -6
  25. data/spec/netsuite/records/billing_schedule_spec.rb +20 -20
  26. data/spec/netsuite/records/campaign_spec.rb +7 -7
  27. data/spec/netsuite/records/classification_spec.rb +10 -10
  28. data/spec/netsuite/records/credit_memo_apply_list_spec.rb +2 -2
  29. data/spec/netsuite/records/credit_memo_apply_spec.rb +1 -1
  30. data/spec/netsuite/records/credit_memo_item_list_spec.rb +2 -2
  31. data/spec/netsuite/records/credit_memo_item_spec.rb +2 -2
  32. data/spec/netsuite/records/credit_memo_spec.rb +26 -26
  33. data/spec/netsuite/records/custom_field_list_spec.rb +10 -10
  34. data/spec/netsuite/records/custom_list_spec.rb +3 -3
  35. data/spec/netsuite/records/custom_record_spec.rb +20 -20
  36. data/spec/netsuite/records/custom_record_type_spec.rb +16 -16
  37. data/spec/netsuite/records/customer_addressbook_list_spec.rb +2 -2
  38. data/spec/netsuite/records/customer_addressbook_spec.rb +38 -28
  39. data/spec/netsuite/records/customer_payment_spec.rb +23 -23
  40. data/spec/netsuite/records/customer_refund_apply_list_spec.rb +2 -2
  41. data/spec/netsuite/records/customer_refund_apply_spec.rb +1 -1
  42. data/spec/netsuite/records/customer_refund_deposit_list_spec.rb +2 -2
  43. data/spec/netsuite/records/customer_refund_deposit_spec.rb +1 -1
  44. data/spec/netsuite/records/customer_refund_spec.rb +28 -28
  45. data/spec/netsuite/records/customer_spec.rb +24 -24
  46. data/spec/netsuite/records/department_spec.rb +16 -16
  47. data/spec/netsuite/records/deposit_spec.rb +24 -24
  48. data/spec/netsuite/records/discount_item_spec.rb +19 -19
  49. data/spec/netsuite/records/duration_spec.rb +1 -1
  50. data/spec/netsuite/records/inventory_item_spec.rb +18 -18
  51. data/spec/netsuite/records/inventory_transfer_spec.rb +5 -5
  52. data/spec/netsuite/records/invoice_item_list_spec.rb +4 -4
  53. data/spec/netsuite/records/invoice_item_spec.rb +11 -11
  54. data/spec/netsuite/records/invoice_spec.rb +32 -32
  55. data/spec/netsuite/records/item_fulfillment_package_list_spec.rb +2 -2
  56. data/spec/netsuite/records/job_spec.rb +31 -31
  57. data/spec/netsuite/records/journal_entry_line_list_spec.rb +2 -2
  58. data/spec/netsuite/records/journal_entry_line_spec.rb +7 -7
  59. data/spec/netsuite/records/journal_entry_spec.rb +25 -25
  60. data/spec/netsuite/records/location_spec.rb +8 -8
  61. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +20 -20
  62. data/spec/netsuite/records/payment_method_spec.rb +8 -8
  63. data/spec/netsuite/records/phone_call_spec.rb +2 -2
  64. data/spec/netsuite/records/pomo_code_spec.rb +7 -7
  65. data/spec/netsuite/records/record_ref_spec.rb +12 -12
  66. data/spec/netsuite/records/rev_rec_template_spec.rb +7 -7
  67. data/spec/netsuite/records/sales_order_item_list_spec.rb +2 -2
  68. data/spec/netsuite/records/sales_order_item_spec.rb +2 -2
  69. data/spec/netsuite/records/sales_order_spec.rb +23 -23
  70. data/spec/netsuite/records/sales_tax_item_spec.rb +2 -2
  71. data/spec/netsuite/records/service_sale_item_spec.rb +20 -20
  72. data/spec/netsuite/records/ship_address_spec.rb +3 -3
  73. data/spec/netsuite/records/site_category_spec.rb +8 -8
  74. data/spec/netsuite/records/subsidiary_spec.rb +2 -2
  75. data/spec/netsuite/records/support_case_spec.rb +25 -25
  76. data/spec/netsuite/records/tax_type_spec.rb +1 -1
  77. data/spec/netsuite/records/term_spec.rb +15 -15
  78. data/spec/netsuite/records/units_type_spec.rb +4 -4
  79. data/spec/netsuite/records/units_type_uom_list_spec.rb +4 -4
  80. data/spec/netsuite/records/units_type_uom_spec.rb +1 -1
  81. data/spec/netsuite/records/work_order_item_list_spec.rb +2 -2
  82. data/spec/netsuite/records/work_order_item_spec.rb +4 -4
  83. data/spec/netsuite/records/work_order_spec.rb +13 -13
  84. data/spec/netsuite/response_spec.rb +4 -4
  85. data/spec/netsuite/support/fields_spec.rb +6 -6
  86. data/spec/netsuite/support/record_refs_spec.rb +1 -1
  87. data/spec/netsuite/support/records_spec.rb +2 -2
  88. data/spec/netsuite/support/requests_spec.rb +6 -6
  89. data/spec/netsuite_spec.rb +4 -4
  90. data/spec/spec_helper.rb +0 -2
  91. data/spec/support/read_only_field_matcher.rb +1 -1
  92. data/spec/support/record_ref_matcher.rb +2 -2
  93. metadata +4 -4
@@ -7,7 +7,7 @@ describe NetSuite::Records::Duration do
7
7
  [
8
8
  :time_span, :unit
9
9
  ].each do |field|
10
- duration.should have_field(field)
10
+ expect(duration).to have_field(field)
11
11
  end
12
12
  end
13
13
 
@@ -27,7 +27,7 @@ describe NetSuite::Records::InventoryItem do
27
27
  :transfer_price, :upc_code, :url_component, :use_bins, :use_marginal_rates, :vendor_name, :vsoe_deferral, :vsoe_delivered,
28
28
  :vsoe_permit_discount, :vsoe_price, :weight, :weight_unit, :weight_units
29
29
  ].each do |field|
30
- item.should have_field(field)
30
+ expect(item).to have_field(field)
31
31
  end
32
32
  end
33
33
 
@@ -35,7 +35,7 @@ describe NetSuite::Records::InventoryItem do
35
35
  [
36
36
  :alternate_demand_source_item, :asset_account, :bill_exch_rate_variance_acct, :bill_price_variance_acct, :bill_qty_variance_acct, :billing_schedule, :cogs_account, :cost_category, :custom_form, :deferred_revenue_account, :demand_source, :department, :expense_account, :gain_loss_account, :income_account, :issue_product, :klass, :location, :parent, :preferred_location, :pricing_group, :purchase_price_variance_acct, :purchase_tax_code, :purchase_unit, :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :ship_package, :soft_descriptor, :stock_unit, :store_display_image, :store_display_thumbnail, :store_item_template, :supply_lot_sizing_method, :supply_replenishment_method, :supply_type, :tax_schedule, :units_type, :vendor
37
37
  ].each do |record_ref|
38
- item.should have_record_ref(record_ref)
38
+ expect(item).to have_record_ref(record_ref)
39
39
  end
40
40
  end
41
41
 
@@ -104,10 +104,10 @@ describe NetSuite::Records::InventoryItem do
104
104
  let(:response) { NetSuite::Response.new(:success => true, :body => { :cost => 100 }) }
105
105
 
106
106
  it 'returns a InventoryItem instance populated with the data from the response object' do
107
- NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::InventoryItem, {:external_id => 1}], {}).and_return(response)
107
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::InventoryItem, {:external_id => 1}], {}).and_return(response)
108
108
  item = NetSuite::Records::InventoryItem.get(:external_id => 1)
109
- item.should be_kind_of(NetSuite::Records::InventoryItem)
110
- item.cost.should eql(100)
109
+ expect(item).to be_kind_of(NetSuite::Records::InventoryItem)
110
+ expect(item.cost).to eql(100)
111
111
  end
112
112
  end
113
113
 
@@ -115,10 +115,10 @@ describe NetSuite::Records::InventoryItem do
115
115
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
116
116
 
117
117
  it 'raises a RecordNotFound exception' do
118
- NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::InventoryItem, {:external_id => 1}], {}).and_return(response)
119
- lambda {
118
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::InventoryItem, {:external_id => 1}], {}).and_return(response)
119
+ expect {
120
120
  NetSuite::Records::InventoryItem.get(:external_id => 1)
121
- }.should raise_error(NetSuite::RecordNotFound,
121
+ }.to raise_error(NetSuite::RecordNotFound,
122
122
  /NetSuite::Records::InventoryItem with OPTIONS=(.*) could not be found/)
123
123
  end
124
124
  end
@@ -131,10 +131,10 @@ describe NetSuite::Records::InventoryItem do
131
131
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
132
132
 
133
133
  it 'returns true' do
134
- NetSuite::Actions::Add.should_receive(:call).
134
+ expect(NetSuite::Actions::Add).to receive(:call).
135
135
  with([item], {}).
136
136
  and_return(response)
137
- item.add.should be_truthy
137
+ expect(item.add).to be_truthy
138
138
  end
139
139
  end
140
140
 
@@ -142,10 +142,10 @@ describe NetSuite::Records::InventoryItem do
142
142
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
143
143
 
144
144
  it 'returns false' do
145
- NetSuite::Actions::Add.should_receive(:call).
145
+ expect(NetSuite::Actions::Add).to receive(:call).
146
146
  with([item], {}).
147
147
  and_return(response)
148
- item.add.should be_falsey
148
+ expect(item.add).to be_falsey
149
149
  end
150
150
  end
151
151
  end
@@ -155,10 +155,10 @@ describe NetSuite::Records::InventoryItem do
155
155
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
156
156
 
157
157
  it 'returns true' do
158
- NetSuite::Actions::Delete.should_receive(:call).
158
+ expect(NetSuite::Actions::Delete).to receive(:call).
159
159
  with([item], {}).
160
160
  and_return(response)
161
- item.delete.should be_truthy
161
+ expect(item.delete).to be_truthy
162
162
  end
163
163
  end
164
164
 
@@ -166,10 +166,10 @@ describe NetSuite::Records::InventoryItem do
166
166
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
167
167
 
168
168
  it 'returns false' do
169
- NetSuite::Actions::Delete.should_receive(:call).
169
+ expect(NetSuite::Actions::Delete).to receive(:call).
170
170
  with([item], {}).
171
171
  and_return(response)
172
- item.delete.should be_falsey
172
+ expect(item.delete).to be_falsey
173
173
  end
174
174
  end
175
175
  end
@@ -184,13 +184,13 @@ describe NetSuite::Records::InventoryItem do
184
184
  'listAcct:cost' => 100,
185
185
  'listAcct:isInactive' => false
186
186
  }
187
- item.to_record.should eql(record)
187
+ expect(item.to_record).to eql(record)
188
188
  end
189
189
  end
190
190
 
191
191
  describe '#record_type' do
192
192
  it 'returns a string representation of the SOAP type' do
193
- item.record_type.should eql('listAcct:InventoryItem')
193
+ expect(item.record_type).to eql('listAcct:InventoryItem')
194
194
  end
195
195
  end
196
196
 
@@ -7,7 +7,7 @@ describe NetSuite::Records::InventoryTransfer do
7
7
  [
8
8
  :created_date, :last_modified_date, :tran_date, :tran_id, :memo
9
9
  ].each do |field|
10
- inventory_transfer.should have_field(field)
10
+ expect(inventory_transfer).to have_field(field)
11
11
  end
12
12
  end
13
13
 
@@ -15,7 +15,7 @@ describe NetSuite::Records::InventoryTransfer do
15
15
  [
16
16
  :posting_period, :location, :transfer_location, :department, :subsidiary
17
17
  ].each do |record_ref|
18
- inventory_transfer.should have_record_ref(record_ref)
18
+ expect(inventory_transfer).to have_record_ref(record_ref)
19
19
  end
20
20
  end
21
21
 
@@ -37,8 +37,8 @@ describe NetSuite::Records::InventoryTransfer do
37
37
  }]
38
38
  }
39
39
  inventory_transfer.inventory_list = attributes
40
- inventory_transfer.inventory_list.should be_kind_of(NetSuite::Records::InventoryTransferInventoryList)
41
- inventory_transfer.inventory_list.inventory.length.should eql(1)
40
+ expect(inventory_transfer.inventory_list).to be_kind_of(NetSuite::Records::InventoryTransferInventoryList)
41
+ expect(inventory_transfer.inventory_list.inventory.length).to eql(1)
42
42
 
43
43
  expect(
44
44
  inventory_transfer.inventory_list.inventory.first.inventory_detail.inventory_assignment_list.inventory_assignment.first.quantity
@@ -52,7 +52,7 @@ describe NetSuite::Records::InventoryTransfer do
52
52
  it 'can be set from a InventoryTransferInventoryList object' do
53
53
  inventory_list = NetSuite::Records::InventoryTransferInventoryList.new
54
54
  inventory_transfer.inventory_list = inventory_list
55
- inventory_transfer.inventory_list.should eql(inventory_list)
55
+ expect(inventory_transfer.inventory_list).to eql(inventory_list)
56
56
  end
57
57
  end
58
58
  end
@@ -7,9 +7,9 @@ describe NetSuite::Records::InvoiceItemList do
7
7
  it 'can have items be added to it' do
8
8
  list.items << item
9
9
  item_list = list.items
10
- item_list.should be_kind_of(Array)
11
- item_list.length.should eql(1)
12
- item_list.each { |i| i.should be_kind_of(NetSuite::Records::InvoiceItem) }
10
+ expect(item_list).to be_kind_of(Array)
11
+ expect(item_list.length).to eql(1)
12
+ item_list.each { |i| expect(i).to be_kind_of(NetSuite::Records::InvoiceItem) }
13
13
  end
14
14
 
15
15
  describe '#to_record' do
@@ -17,7 +17,7 @@ describe NetSuite::Records::InvoiceItemList do
17
17
  record = {
18
18
  'tranSales:item' => []
19
19
  }
20
- list.to_record.should eql(record)
20
+ expect(list.to_record).to eql(record)
21
21
  end
22
22
  end
23
23
 
@@ -13,7 +13,7 @@ describe NetSuite::Records::InvoiceItem do
13
13
  :tax1_amt, :tax_rate1, :tax_rate2, :vsoe_allocation, :vsoe_amount, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount,
14
14
  :vsoe_price
15
15
  ].each do |field|
16
- item.should have_field(field)
16
+ expect(item).to have_field(field)
17
17
  end
18
18
  end
19
19
 
@@ -22,16 +22,16 @@ describe NetSuite::Records::InvoiceItem do
22
22
  :department, :item, :job, :location, :price, :rev_rec_schedule, :ship_address, :ship_method, :tax_code, :units,
23
23
  :klass
24
24
  ].each do |record_ref|
25
- item.should have_record_ref(record_ref)
25
+ expect(item).to have_record_ref(record_ref)
26
26
  end
27
27
  end
28
28
 
29
29
  it 'can initialize from a record' do
30
30
  record = NetSuite::Records::InvoiceItem.new(:amount => 123, :cost_estimate => 234)
31
31
  item = NetSuite::Records::InvoiceItem.new(record)
32
- item.should be_kind_of(NetSuite::Records::InvoiceItem)
33
- item.amount.should eql(123)
34
- item.cost_estimate.should eql(234)
32
+ expect(item).to be_kind_of(NetSuite::Records::InvoiceItem)
33
+ expect(item.amount).to eql(123)
34
+ expect(item.cost_estimate).to eql(234)
35
35
  end
36
36
 
37
37
  describe '#custom_field_list' do
@@ -43,15 +43,15 @@ describe NetSuite::Records::InvoiceItem do
43
43
  }
44
44
  }
45
45
  item.custom_field_list = attributes
46
- item.custom_field_list.should be_kind_of(NetSuite::Records::CustomFieldList)
47
- item.custom_field_list.custom_fields.length.should eql(1)
48
- item.custom_field_list.custfield_value.attributes[:value].should eq(10)
46
+ expect(item.custom_field_list).to be_kind_of(NetSuite::Records::CustomFieldList)
47
+ expect(item.custom_field_list.custom_fields.length).to eql(1)
48
+ expect(item.custom_field_list.custfield_value.attributes[:value]).to eq(10)
49
49
  end
50
50
 
51
51
  it 'can be set from a CustomFieldList object' do
52
52
  custom_field_list = NetSuite::Records::CustomFieldList.new
53
53
  item.custom_field_list = custom_field_list
54
- item.custom_field_list.should eql(custom_field_list)
54
+ expect(item.custom_field_list).to eql(custom_field_list)
55
55
  end
56
56
  end
57
57
 
@@ -66,13 +66,13 @@ describe NetSuite::Records::InvoiceItem do
66
66
  'tranSales:amount' => '7',
67
67
  'tranSales:description' => 'Some thingy'
68
68
  }
69
- item.to_record.should eql(record)
69
+ expect(item.to_record).to eql(record)
70
70
  end
71
71
  end
72
72
 
73
73
  describe '#record_type' do
74
74
  it 'returns a string of the SOAP record type' do
75
- item.record_type.should eql('tranSales:InvoiceItem')
75
+ expect(item.record_type).to eql('tranSales:InvoiceItem')
76
76
  end
77
77
  end
78
78
 
@@ -28,7 +28,7 @@ describe NetSuite::Records::Invoice do
28
28
  :to_be_printed, :total_cost_estimate, :tracking_numbers, :tran_date, :tran_id, :tran_is_vsoe_bundle,
29
29
  :vat_reg_num, :vsoe_auto_calc
30
30
  ].each do |field|
31
- invoice.should have_field(field)
31
+ expect(invoice).to have_field(field)
32
32
  end
33
33
  end
34
34
 
@@ -37,7 +37,7 @@ describe NetSuite::Records::Invoice do
37
37
  :sub_total, :discount_total, :total, :alt_handling_cost, :alt_shipping_cost, :gift_cert_applied, :tax_rate,
38
38
  :handling_cost, :recognized_revenue, :amount_remaining, :amount_paid
39
39
  ].each do |field|
40
- NetSuite::Records::Invoice.should have_read_only_field(field)
40
+ expect(NetSuite::Records::Invoice).to have_read_only_field(field)
41
41
  end
42
42
  end
43
43
 
@@ -46,7 +46,7 @@ describe NetSuite::Records::Invoice do
46
46
  :account, :bill_address_list, :custom_form, :department, :entity, :klass, :posting_period, :ship_address_list, :terms,
47
47
  :created_from, :location, :sales_rep, :ship_method, :tax_item, :partner
48
48
  ].each do |record_ref|
49
- invoice.should have_record_ref(record_ref)
49
+ expect(invoice).to have_record_ref(record_ref)
50
50
  end
51
51
  end
52
52
 
@@ -59,14 +59,14 @@ describe NetSuite::Records::Invoice do
59
59
  }
60
60
  }
61
61
  invoice.custom_field_list = attributes
62
- invoice.custom_field_list.should be_kind_of(NetSuite::Records::CustomFieldList)
63
- invoice.custom_field_list.custom_fields.length.should eql(1)
62
+ expect(invoice.custom_field_list).to be_kind_of(NetSuite::Records::CustomFieldList)
63
+ expect(invoice.custom_field_list.custom_fields.length).to eql(1)
64
64
  end
65
65
 
66
66
  it 'can be set from a CustomFieldList object' do
67
67
  custom_field_list = NetSuite::Records::CustomFieldList.new
68
68
  invoice.custom_field_list = custom_field_list
69
- invoice.custom_field_list.should eql(custom_field_list)
69
+ expect(invoice.custom_field_list).to eql(custom_field_list)
70
70
  end
71
71
  end
72
72
 
@@ -78,14 +78,14 @@ describe NetSuite::Records::Invoice do
78
78
  }
79
79
  }
80
80
  invoice.item_list = attributes
81
- invoice.item_list.should be_kind_of(NetSuite::Records::InvoiceItemList)
82
- invoice.item_list.items.length.should eql(1)
81
+ expect(invoice.item_list).to be_kind_of(NetSuite::Records::InvoiceItemList)
82
+ expect(invoice.item_list.items.length).to eql(1)
83
83
  end
84
84
 
85
85
  it 'can be set from a CustomFieldList object' do
86
86
  item_list = NetSuite::Records::InvoiceItemList.new
87
87
  invoice.item_list = item_list
88
- invoice.item_list.should eql(item_list)
88
+ expect(invoice.item_list).to eql(item_list)
89
89
  end
90
90
  end
91
91
 
@@ -99,14 +99,14 @@ describe NetSuite::Records::Invoice do
99
99
  :bill_state => 'CA',
100
100
  :bill_zip => '90007'
101
101
  }
102
- invoice.transaction_bill_address.should be_kind_of(NetSuite::Records::BillAddress)
103
- invoice.transaction_bill_address.bill_city.should eql('Los Angeles')
102
+ expect(invoice.transaction_bill_address).to be_kind_of(NetSuite::Records::BillAddress)
103
+ expect(invoice.transaction_bill_address.bill_city).to eql('Los Angeles')
104
104
  end
105
105
 
106
106
  it 'can be set with a BillAddress object' do
107
107
  bill_address = NetSuite::Records::BillAddress.new
108
108
  invoice.transaction_bill_address = bill_address
109
- invoice.transaction_bill_address.should eql(bill_address)
109
+ expect(invoice.transaction_bill_address).to eql(bill_address)
110
110
  end
111
111
  end
112
112
 
@@ -121,14 +121,14 @@ describe NetSuite::Records::Invoice do
121
121
  :ship_state => 'CA',
122
122
  :ship_zip => '90007'
123
123
  }
124
- invoice.transaction_ship_address.should be_kind_of(NetSuite::Records::ShipAddress)
125
- invoice.transaction_ship_address.ship_addr1.should eql('123 Happy Lane')
124
+ expect(invoice.transaction_ship_address).to be_kind_of(NetSuite::Records::ShipAddress)
125
+ expect(invoice.transaction_ship_address.ship_addr1).to eql('123 Happy Lane')
126
126
  end
127
127
 
128
128
  it 'can be set with a ShipAddress object' do
129
129
  ship_address = NetSuite::Records::ShipAddress.new
130
130
  invoice.transaction_ship_address = ship_address
131
- invoice.transaction_ship_address.should eql(ship_address)
131
+ expect(invoice.transaction_ship_address).to eql(ship_address)
132
132
  end
133
133
  end
134
134
 
@@ -137,9 +137,9 @@ describe NetSuite::Records::Invoice do
137
137
  let(:response) { NetSuite::Response.new(:success => true, :body => { :is_person => true }) }
138
138
 
139
139
  it 'returns an Invoice instance populated with the data from the response object' do
140
- NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Invoice, {:external_id => 10}], {}).and_return(response)
140
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Invoice, {:external_id => 10}], {}).and_return(response)
141
141
  invoice = NetSuite::Records::Invoice.get(:external_id => 10)
142
- invoice.should be_kind_of(NetSuite::Records::Invoice)
142
+ expect(invoice).to be_kind_of(NetSuite::Records::Invoice)
143
143
  end
144
144
  end
145
145
 
@@ -147,10 +147,10 @@ describe NetSuite::Records::Invoice do
147
147
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
148
148
 
149
149
  it 'raises a RecordNotFound exception' do
150
- NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Invoice, {:external_id => 10}], {}).and_return(response)
151
- lambda {
150
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Invoice, {:external_id => 10}], {}).and_return(response)
151
+ expect {
152
152
  NetSuite::Records::Invoice.get(:external_id => 10)
153
- }.should raise_error(NetSuite::RecordNotFound,
153
+ }.to raise_error(NetSuite::RecordNotFound,
154
154
  /NetSuite::Records::Invoice with OPTIONS=(.*) could not be found/)
155
155
  end
156
156
  end
@@ -159,9 +159,9 @@ describe NetSuite::Records::Invoice do
159
159
  describe '.initialize' do
160
160
  context 'when the request is successful' do
161
161
  it 'returns an initialized invoice from the customer entity' do
162
- NetSuite::Actions::Initialize.should_receive(:call).with([NetSuite::Records::Invoice, customer], {}).and_return(response)
162
+ expect(NetSuite::Actions::Initialize).to receive(:call).with([NetSuite::Records::Invoice, customer], {}).and_return(response)
163
163
  invoice = NetSuite::Records::Invoice.initialize(customer)
164
- invoice.should be_kind_of(NetSuite::Records::Invoice)
164
+ expect(invoice).to be_kind_of(NetSuite::Records::Invoice)
165
165
  end
166
166
  end
167
167
 
@@ -178,10 +178,10 @@ describe NetSuite::Records::Invoice do
178
178
 
179
179
  it 'returns true' do
180
180
  invoice = NetSuite::Records::Invoice.new(test_data)
181
- NetSuite::Actions::Add.should_receive(:call).
181
+ expect(NetSuite::Actions::Add).to receive(:call).
182
182
  with([invoice], {}).
183
183
  and_return(response)
184
- invoice.add.should be_truthy
184
+ expect(invoice.add).to be_truthy
185
185
  end
186
186
  end
187
187
 
@@ -190,10 +190,10 @@ describe NetSuite::Records::Invoice do
190
190
 
191
191
  it 'returns false' do
192
192
  invoice = NetSuite::Records::Invoice.new(test_data)
193
- NetSuite::Actions::Add.should_receive(:call).
193
+ expect(NetSuite::Actions::Add).to receive(:call).
194
194
  with([invoice], {}).
195
195
  and_return(response)
196
- invoice.add.should be_falsey
196
+ expect(invoice.add).to be_falsey
197
197
  end
198
198
  end
199
199
  end
@@ -204,10 +204,10 @@ describe NetSuite::Records::Invoice do
204
204
 
205
205
  it 'returns true' do
206
206
  invoice = NetSuite::Records::Invoice.new
207
- NetSuite::Actions::Delete.should_receive(:call).
207
+ expect(NetSuite::Actions::Delete).to receive(:call).
208
208
  with([invoice], {}).
209
209
  and_return(response)
210
- invoice.delete.should be_truthy
210
+ expect(invoice.delete).to be_truthy
211
211
  end
212
212
  end
213
213
 
@@ -216,10 +216,10 @@ describe NetSuite::Records::Invoice do
216
216
 
217
217
  it 'returns false' do
218
218
  invoice = NetSuite::Records::Invoice.new
219
- NetSuite::Actions::Delete.should_receive(:call).
219
+ expect(NetSuite::Actions::Delete).to receive(:call).
220
220
  with([invoice], {}).
221
221
  and_return(response)
222
- invoice.delete.should be_falsey
222
+ expect(invoice.delete).to be_falsey
223
223
  end
224
224
  end
225
225
  end
@@ -234,13 +234,13 @@ describe NetSuite::Records::Invoice do
234
234
  'tranSales:email' => 'something@example.com',
235
235
  'tranSales:tranId' => '4'
236
236
  }
237
- invoice.to_record.should eql(record)
237
+ expect(invoice.to_record).to eql(record)
238
238
  end
239
239
  end
240
240
 
241
241
  describe '#record_type' do
242
242
  it 'returns a string representation of the SOAP type' do
243
- invoice.record_type.should eql('tranSales:Invoice')
243
+ expect(invoice.record_type).to eql('tranSales:Invoice')
244
244
  end
245
245
  end
246
246
 
@@ -4,7 +4,7 @@ describe NetSuite::Records::ItemFulfillmentPackageList do
4
4
  let(:list) { NetSuite::Records::ItemFulfillmentPackageList.new }
5
5
 
6
6
  it 'has a packages attribute' do
7
- list.packages.should be_kind_of(Array)
7
+ expect(list.packages).to be_kind_of(Array)
8
8
  end
9
9
 
10
10
  describe '#to_record' do
@@ -21,7 +21,7 @@ describe NetSuite::Records::ItemFulfillmentPackageList do
21
21
  ]
22
22
  }
23
23
 
24
- list.to_record.should eql(record)
24
+ expect(list.to_record).to eql(record)
25
25
  end
26
26
  end
27
27
  end