netsuite 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +32 -0
  3. data/lib/netsuite.rb +5 -1
  4. data/lib/netsuite/actions/add.rb +4 -4
  5. data/lib/netsuite/actions/delete.rb +7 -7
  6. data/lib/netsuite/actions/get.rb +5 -5
  7. data/lib/netsuite/actions/get_list.rb +24 -11
  8. data/lib/netsuite/actions/get_select_value.rb +5 -5
  9. data/lib/netsuite/actions/initialize.rb +5 -5
  10. data/lib/netsuite/actions/login.rb +33 -0
  11. data/lib/netsuite/actions/search.rb +5 -5
  12. data/lib/netsuite/actions/update.rb +5 -5
  13. data/lib/netsuite/actions/upsert.rb +4 -4
  14. data/lib/netsuite/configuration.rb +9 -9
  15. data/lib/netsuite/records/account.rb +1 -1
  16. data/lib/netsuite/records/custom_field_list.rb +2 -0
  17. data/lib/netsuite/records/custom_record.rb +1 -1
  18. data/lib/netsuite/records/customer.rb +9 -6
  19. data/lib/netsuite/records/deposit.rb +2 -2
  20. data/lib/netsuite/records/deposit_cash_back.rb +42 -0
  21. data/lib/netsuite/records/deposit_cash_back_list.rb +32 -0
  22. data/lib/netsuite/records/deposit_other.rb +45 -0
  23. data/lib/netsuite/records/deposit_other_list.rb +32 -0
  24. data/lib/netsuite/records/item_fulfillment.rb +7 -1
  25. data/lib/netsuite/records/item_fulfillment_item.rb +1 -1
  26. data/lib/netsuite/records/item_fulfillment_package_list.rb +22 -1
  27. data/lib/netsuite/records/sales_order.rb +1 -1
  28. data/lib/netsuite/records/service_sale_item.rb +1 -1
  29. data/lib/netsuite/support/requests.rb +5 -4
  30. data/lib/netsuite/version.rb +1 -1
  31. data/netsuite.gemspec +1 -1
  32. data/spec/netsuite/actions/add_spec.rb +5 -5
  33. data/spec/netsuite/actions/delete_spec.rb +2 -2
  34. data/spec/netsuite/actions/get_spec.rb +4 -4
  35. data/spec/netsuite/actions/initialize_spec.rb +2 -2
  36. data/spec/netsuite/actions/search_spec.rb +6 -6
  37. data/spec/netsuite/actions/update_spec.rb +4 -4
  38. data/spec/netsuite/actions/upsert_spec.rb +5 -5
  39. data/spec/netsuite/records/account_spec.rb +6 -6
  40. data/spec/netsuite/records/accounting_period_spec.rb +6 -6
  41. data/spec/netsuite/records/classification_spec.rb +4 -4
  42. data/spec/netsuite/records/credit_memo_spec.rb +8 -8
  43. data/spec/netsuite/records/custom_field_list_spec.rb +10 -0
  44. data/spec/netsuite/records/custom_field_spec.rb +1 -1
  45. data/spec/netsuite/records/custom_record_ref_spec.rb +1 -1
  46. data/spec/netsuite/records/custom_record_spec.rb +6 -6
  47. data/spec/netsuite/records/custom_record_type_spec.rb +6 -6
  48. data/spec/netsuite/records/customer_payment_spec.rb +9 -9
  49. data/spec/netsuite/records/customer_refund_spec.rb +8 -8
  50. data/spec/netsuite/records/customer_spec.rb +10 -10
  51. data/spec/netsuite/records/department_spec.rb +6 -6
  52. data/spec/netsuite/records/deposit_spec.rb +10 -10
  53. data/spec/netsuite/records/inventory_item_spec.rb +6 -6
  54. data/spec/netsuite/records/invoice_spec.rb +8 -8
  55. data/spec/netsuite/records/item_fulfillment_package_list_spec.rb +27 -0
  56. data/spec/netsuite/records/item_fulfillment_spec.rb +49 -0
  57. data/spec/netsuite/records/job_spec.rb +8 -8
  58. data/spec/netsuite/records/journal_entry_spec.rb +6 -6
  59. data/spec/netsuite/records/location_spec.rb +2 -2
  60. data/spec/netsuite/records/non_inventory_sale_item_spec.rb +6 -6
  61. data/spec/netsuite/records/payment_method_spec.rb +2 -2
  62. data/spec/netsuite/records/rev_rec_template_spec.rb +2 -2
  63. data/spec/netsuite/records/sales_order_spec.rb +9 -9
  64. data/spec/netsuite/records/service_sale_item_spec.rb +6 -6
  65. data/spec/netsuite/records/support_case_spec.rb +8 -8
  66. data/spec/netsuite/records/term_spec.rb +6 -6
  67. data/spec/netsuite/support/actions_spec.rb +1 -1
  68. data/spec/netsuite/support/attributes_spec.rb +1 -1
  69. data/spec/spec_helper.rb +1 -1
  70. metadata +13 -5
  71. data/lib/netsuite/actions/search_more_with_id.rb +0 -107
@@ -108,7 +108,7 @@ describe NetSuite::Records::Job do
108
108
  let(:response) { NetSuite::Response.new(:success => true, :body => { :account_number => 7 }) }
109
109
 
110
110
  it 'returns a Job instance populated with the data from the response object' do
111
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::Job, :external_id => 1).and_return(response)
111
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Job, {:external_id => 1}], {}).and_return(response)
112
112
  job = NetSuite::Records::Job.get(:external_id => 1)
113
113
  job.should be_kind_of(NetSuite::Records::Job)
114
114
  job.account_number.should be_true
@@ -119,7 +119,7 @@ describe NetSuite::Records::Job do
119
119
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
120
120
 
121
121
  it 'raises a RecordNotFound exception' do
122
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::Job, :external_id => 1).and_return(response)
122
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Job, {:external_id => 1}], {}).and_return(response)
123
123
  lambda {
124
124
  NetSuite::Records::Job.get(:external_id => 1)
125
125
  }.should raise_error(NetSuite::RecordNotFound,
@@ -136,7 +136,7 @@ describe NetSuite::Records::Job do
136
136
 
137
137
  it 'returns true' do
138
138
  NetSuite::Actions::Add.should_receive(:call).
139
- with(job).
139
+ with([job], {}).
140
140
  and_return(response)
141
141
  job.add.should be_true
142
142
  end
@@ -147,7 +147,7 @@ describe NetSuite::Records::Job do
147
147
 
148
148
  it 'returns false' do
149
149
  NetSuite::Actions::Add.should_receive(:call).
150
- with(job).
150
+ with([job], {}).
151
151
  and_return(response)
152
152
  job.add.should be_false
153
153
  end
@@ -160,7 +160,7 @@ describe NetSuite::Records::Job do
160
160
 
161
161
  it 'returns true' do
162
162
  NetSuite::Actions::Delete.should_receive(:call).
163
- with(job).
163
+ with([job], {}).
164
164
  and_return(response)
165
165
  job.delete.should be_true
166
166
  end
@@ -171,7 +171,7 @@ describe NetSuite::Records::Job do
171
171
 
172
172
  it 'returns false' do
173
173
  NetSuite::Actions::Delete.should_receive(:call).
174
- with(job).
174
+ with([job], {}).
175
175
  and_return(response)
176
176
  job.delete.should be_false
177
177
  end
@@ -183,7 +183,7 @@ describe NetSuite::Records::Job do
183
183
  let(:response) { NetSuite::Response.new(:success => true, :body => { :account_number => 7 }) }
184
184
 
185
185
  it 'returns true' do
186
- NetSuite::Actions::Update.should_receive(:call).with(NetSuite::Records::Job, :external_id => 1, :account_number => 7).and_return(response)
186
+ NetSuite::Actions::Update.should_receive(:call).with([NetSuite::Records::Job, {:external_id => 1, :account_number => 7}], {}).and_return(response)
187
187
  job = NetSuite::Records::Job.new(:external_id => 1)
188
188
  job.update(:account_number => 7).should be_true
189
189
  end
@@ -193,7 +193,7 @@ describe NetSuite::Records::Job do
193
193
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
194
194
 
195
195
  it 'raises a RecordNotFound exception' do
196
- NetSuite::Actions::Update.should_receive(:call).with(NetSuite::Records::Job, :internal_id => 1, :account_number => 7).and_return(response)
196
+ NetSuite::Actions::Update.should_receive(:call).with([NetSuite::Records::Job, {:internal_id => 1, :account_number => 7}], {}).and_return(response)
197
197
  job = NetSuite::Records::Job.new(:internal_id => 1)
198
198
  job.update(:account_number => 7).should be_false
199
199
  end
@@ -66,7 +66,7 @@ describe NetSuite::Records::JournalEntry do
66
66
  let(:response) { NetSuite::Response.new(:success => true, :body => { :approved => true }) }
67
67
 
68
68
  it 'returns a JournalEntry instance populated with the data from the response object' do
69
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::JournalEntry, :external_id => 1).and_return(response)
69
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::JournalEntry, {:external_id => 1}], {}).and_return(response)
70
70
  customer = NetSuite::Records::JournalEntry.get(:external_id => 1)
71
71
  customer.should be_kind_of(NetSuite::Records::JournalEntry)
72
72
  customer.approved.should be_true
@@ -77,7 +77,7 @@ describe NetSuite::Records::JournalEntry do
77
77
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
78
78
 
79
79
  it 'raises a RecordNotFound exception' do
80
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::JournalEntry, :external_id => 1).and_return(response)
80
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::JournalEntry, {:external_id => 1}], {}).and_return(response)
81
81
  lambda {
82
82
  NetSuite::Records::JournalEntry.get(:external_id => 1)
83
83
  }.should raise_error(NetSuite::RecordNotFound,
@@ -94,7 +94,7 @@ describe NetSuite::Records::JournalEntry do
94
94
 
95
95
  it 'returns true' do
96
96
  NetSuite::Actions::Add.should_receive(:call).
97
- with(entry).
97
+ with([entry], {}).
98
98
  and_return(response)
99
99
  entry.add.should be_true
100
100
  end
@@ -105,7 +105,7 @@ describe NetSuite::Records::JournalEntry do
105
105
 
106
106
  it 'returns false' do
107
107
  NetSuite::Actions::Add.should_receive(:call).
108
- with(entry).
108
+ with([entry], {}).
109
109
  and_return(response)
110
110
  entry.add.should be_false
111
111
  end
@@ -118,7 +118,7 @@ describe NetSuite::Records::JournalEntry do
118
118
 
119
119
  it 'returns true' do
120
120
  NetSuite::Actions::Delete.should_receive(:call).
121
- with(entry).
121
+ with([entry], {}).
122
122
  and_return(response)
123
123
  entry.delete.should be_true
124
124
  end
@@ -129,7 +129,7 @@ describe NetSuite::Records::JournalEntry do
129
129
 
130
130
  it 'returns false' do
131
131
  NetSuite::Actions::Delete.should_receive(:call).
132
- with(entry).
132
+ with([entry], {}).
133
133
  and_return(response)
134
134
  entry.delete.should be_false
135
135
  end
@@ -40,7 +40,7 @@ describe NetSuite::Records::Location do
40
40
  let(:response) { NetSuite::Response.new(:success => true, :body => { :city => 'Los Angeles' }) }
41
41
 
42
42
  it 'returns a Location instance populated with the data from the response object' do
43
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::Location, :external_id => 1).and_return(response)
43
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Location, {:external_id => 1}], {}).and_return(response)
44
44
  location = NetSuite::Records::Location.get(:external_id => 1)
45
45
  location.should be_kind_of(NetSuite::Records::Location)
46
46
  location.city.should eql('Los Angeles')
@@ -51,7 +51,7 @@ describe NetSuite::Records::Location do
51
51
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
52
52
 
53
53
  it 'raises a RecordNotFound exception' do
54
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::Location, :external_id => 1).and_return(response)
54
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Location, {:external_id => 1}], {}).and_return(response)
55
55
  lambda {
56
56
  NetSuite::Records::Location.get(:external_id => 1)
57
57
  }.should raise_error(NetSuite::RecordNotFound,
@@ -44,7 +44,7 @@ describe NetSuite::Records::NonInventorySaleItem do
44
44
  let(:response) { NetSuite::Response.new(:success => true, :body => { :manufacturer_zip => '90401' }) }
45
45
 
46
46
  it 'returns a NonInventorySaleItem instance populated with the data from the response object' do
47
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::NonInventorySaleItem, :external_id => 20).and_return(response)
47
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::NonInventorySaleItem, {:external_id => 20}], {}).and_return(response)
48
48
  customer = NetSuite::Records::NonInventorySaleItem.get(:external_id => 20)
49
49
  customer.should be_kind_of(NetSuite::Records::NonInventorySaleItem)
50
50
  customer.manufacturer_zip.should eql('90401')
@@ -55,7 +55,7 @@ describe NetSuite::Records::NonInventorySaleItem do
55
55
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
56
56
 
57
57
  it 'raises a RecordNotFound exception' do
58
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::NonInventorySaleItem, :external_id => 20).and_return(response)
58
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::NonInventorySaleItem, {:external_id => 20}], {}).and_return(response)
59
59
  lambda {
60
60
  NetSuite::Records::NonInventorySaleItem.get(:external_id => 20)
61
61
  }.should raise_error(NetSuite::RecordNotFound,
@@ -72,7 +72,7 @@ describe NetSuite::Records::NonInventorySaleItem do
72
72
 
73
73
  it 'returns true' do
74
74
  NetSuite::Actions::Add.should_receive(:call).
75
- with(item).
75
+ with([item], {}).
76
76
  and_return(response)
77
77
  item.add.should be_true
78
78
  end
@@ -83,7 +83,7 @@ describe NetSuite::Records::NonInventorySaleItem do
83
83
 
84
84
  it 'returns false' do
85
85
  NetSuite::Actions::Add.should_receive(:call).
86
- with(item).
86
+ with([item], {}).
87
87
  and_return(response)
88
88
  item.add.should be_false
89
89
  end
@@ -96,7 +96,7 @@ describe NetSuite::Records::NonInventorySaleItem do
96
96
 
97
97
  it 'returns true' do
98
98
  NetSuite::Actions::Delete.should_receive(:call).
99
- with(item).
99
+ with([item], {}).
100
100
  and_return(response)
101
101
  item.delete.should be_true
102
102
  end
@@ -107,7 +107,7 @@ describe NetSuite::Records::NonInventorySaleItem do
107
107
 
108
108
  it 'returns false' do
109
109
  NetSuite::Actions::Delete.should_receive(:call).
110
- with(item).
110
+ with([item], {}).
111
111
  and_return(response)
112
112
  item.delete.should be_false
113
113
  end
@@ -30,7 +30,7 @@ describe NetSuite::Records::PaymentMethod do
30
30
  let(:response) { NetSuite::Response.new(:success => true, :body => { :is_debit_card => true }) }
31
31
 
32
32
  it 'returns an PaymentMethod instance populated with the data from the response object' do
33
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::PaymentMethod, :external_id => 10).and_return(response)
33
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::PaymentMethod, :external_id => 10], {}).and_return(response)
34
34
  payment_method = NetSuite::Records::PaymentMethod.get(:external_id => 10)
35
35
  payment_method.should be_kind_of(NetSuite::Records::PaymentMethod)
36
36
  payment_method.is_debit_card.should be_true
@@ -41,7 +41,7 @@ describe NetSuite::Records::PaymentMethod do
41
41
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
42
42
 
43
43
  it 'raises a RecordNotFound exception' do
44
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::PaymentMethod, :external_id => 10).and_return(response)
44
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::PaymentMethod, :external_id => 10], {}).and_return(response)
45
45
  lambda {
46
46
  NetSuite::Records::PaymentMethod.get(:external_id => 10)
47
47
  }.should raise_error(NetSuite::RecordNotFound,
@@ -16,7 +16,7 @@ describe NetSuite::Records::RevRecTemplate do
16
16
  let(:response) { NetSuite::Response.new(:success => true, :body => { :name => 'A template' }) }
17
17
 
18
18
  it 'returns an RevRecTemplate instance populated with the data from the response object' do
19
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::RevRecTemplate, :external_id => 10).and_return(response)
19
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::RevRecTemplate, :external_id => 10], {}).and_return(response)
20
20
  template = NetSuite::Records::RevRecTemplate.get(:external_id => 10)
21
21
  template.should be_kind_of(NetSuite::Records::RevRecTemplate)
22
22
  template.name.should eql('A template')
@@ -27,7 +27,7 @@ describe NetSuite::Records::RevRecTemplate do
27
27
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
28
28
 
29
29
  it 'raises a RecordNotFound exception' do
30
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::RevRecTemplate, :external_id => 10).and_return(response)
30
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::RevRecTemplate, :external_id => 10], {}).and_return(response)
31
31
  lambda {
32
32
  NetSuite::Records::RevRecTemplate.get(:external_id => 10)
33
33
  }.should raise_error(NetSuite::RecordNotFound,
@@ -93,7 +93,7 @@ describe NetSuite::Records::SalesOrder do
93
93
  let(:response) { NetSuite::Response.new(:success => true, :body => { :alt_shipping_cost => 100 }) }
94
94
 
95
95
  it 'returns a SalesOrder instance populated with the data from the response object' do
96
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::SalesOrder, :external_id => 1).and_return(response)
96
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::SalesOrder, :external_id => 1], {}).and_return(response)
97
97
  salesorder = NetSuite::Records::SalesOrder.get(:external_id => 1)
98
98
  salesorder.should be_kind_of(NetSuite::Records::SalesOrder)
99
99
  salesorder.alt_shipping_cost.should eql(100)
@@ -104,7 +104,7 @@ describe NetSuite::Records::SalesOrder do
104
104
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
105
105
 
106
106
  it 'raises a RecordNotFound exception' do
107
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::SalesOrder, :external_id => 1).and_return(response)
107
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::SalesOrder, :external_id => 1], {}).and_return(response)
108
108
  lambda {
109
109
  NetSuite::Records::SalesOrder.get(:external_id => 1)
110
110
  }.should raise_error(NetSuite::RecordNotFound,
@@ -116,14 +116,14 @@ describe NetSuite::Records::SalesOrder do
116
116
  describe '.initialize' do
117
117
  context 'when the request is successful' do
118
118
  it 'returns an initialized sales order from the customer entity' do
119
- NetSuite::Actions::Initialize.should_receive(:call).with(NetSuite::Records::SalesOrder, customer).and_return(response)
119
+ NetSuite::Actions::Initialize.should_receive(:call).with([NetSuite::Records::SalesOrder, customer], {}).and_return(response)
120
120
  salesorder = NetSuite::Records::SalesOrder.initialize(customer)
121
121
  salesorder.should be_kind_of(NetSuite::Records::SalesOrder)
122
122
  end
123
123
  end
124
124
 
125
125
  context 'when the response is unsuccessful' do
126
- pending
126
+ skip
127
127
  end
128
128
  end
129
129
 
@@ -136,7 +136,7 @@ describe NetSuite::Records::SalesOrder do
136
136
  it 'returns true' do
137
137
  salesorder = NetSuite::Records::SalesOrder.new(test_data)
138
138
  NetSuite::Actions::Add.should_receive(:call).
139
- with(salesorder).
139
+ with([salesorder], {}).
140
140
  and_return(response)
141
141
  salesorder.add.should be_true
142
142
  end
@@ -148,7 +148,7 @@ describe NetSuite::Records::SalesOrder do
148
148
  it 'returns false' do
149
149
  salesorder = NetSuite::Records::SalesOrder.new(test_data)
150
150
  NetSuite::Actions::Add.should_receive(:call).
151
- with(salesorder).
151
+ with([salesorder], {}).
152
152
  and_return(response)
153
153
  salesorder.add.should be_false
154
154
  end
@@ -164,7 +164,7 @@ describe NetSuite::Records::SalesOrder do
164
164
  it 'returns true' do
165
165
  salesorder = NetSuite::Records::SalesOrder.new(test_data)
166
166
  NetSuite::Actions::Delete.should_receive(:call).
167
- with(salesorder).
167
+ with([salesorder], {}).
168
168
  and_return(response)
169
169
  salesorder.delete.should be_true
170
170
  end
@@ -176,7 +176,7 @@ describe NetSuite::Records::SalesOrder do
176
176
  it 'returns false' do
177
177
  salesorder = NetSuite::Records::SalesOrder.new(test_data)
178
178
  NetSuite::Actions::Delete.should_receive(:call).
179
- with(salesorder).
179
+ with([salesorder], {}).
180
180
  and_return(response)
181
181
  salesorder.delete.should be_false
182
182
  end
@@ -203,7 +203,7 @@ describe NetSuite::Records::SalesOrder do
203
203
  end
204
204
  end
205
205
 
206
- pending "closing a sales order" do
206
+ skip "closing a sales order" do
207
207
  it "closes each line to close the sales order" do
208
208
  attributes = sales_order.attributes
209
209
  attributes[:item_list].items.each do |item|
@@ -40,7 +40,7 @@ describe NetSuite::Records::ServiceSaleItem do
40
40
  let(:response) { NetSuite::Response.new(:success => true, :body => { :item_id => 'penguins' }) }
41
41
 
42
42
  it 'returns a ServiceSaleItem instance populated with the data from the response object' do
43
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::ServiceSaleItem, :external_id => 20).and_return(response)
43
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::ServiceSaleItem, :external_id => 20], {}).and_return(response)
44
44
  customer = NetSuite::Records::ServiceSaleItem.get(:external_id => 20)
45
45
  customer.should be_kind_of(NetSuite::Records::ServiceSaleItem)
46
46
  customer.item_id.should eql('penguins')
@@ -51,7 +51,7 @@ describe NetSuite::Records::ServiceSaleItem do
51
51
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
52
52
 
53
53
  it 'raises a RecordNotFound exception' do
54
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::ServiceSaleItem, :external_id => 20).and_return(response)
54
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::ServiceSaleItem, :external_id => 20], {}).and_return(response)
55
55
  lambda {
56
56
  NetSuite::Records::ServiceSaleItem.get(:external_id => 20)
57
57
  }.should raise_error(NetSuite::RecordNotFound,
@@ -68,7 +68,7 @@ describe NetSuite::Records::ServiceSaleItem do
68
68
 
69
69
  it 'returns true' do
70
70
  NetSuite::Actions::Add.should_receive(:call).
71
- with(item).
71
+ with([item], {}).
72
72
  and_return(response)
73
73
  item.add.should be_true
74
74
  end
@@ -79,7 +79,7 @@ describe NetSuite::Records::ServiceSaleItem do
79
79
 
80
80
  it 'returns false' do
81
81
  NetSuite::Actions::Add.should_receive(:call).
82
- with(item).
82
+ with([item], {}).
83
83
  and_return(response)
84
84
  item.add.should be_false
85
85
  end
@@ -92,7 +92,7 @@ describe NetSuite::Records::ServiceSaleItem do
92
92
 
93
93
  it 'returns true' do
94
94
  NetSuite::Actions::Delete.should_receive(:call).
95
- with(item).
95
+ with([item], {}).
96
96
  and_return(response)
97
97
  item.delete.should be_true
98
98
  end
@@ -103,7 +103,7 @@ describe NetSuite::Records::ServiceSaleItem do
103
103
 
104
104
  it 'returns false' do
105
105
  NetSuite::Actions::Delete.should_receive(:call).
106
- with(item).
106
+ with([item], {}).
107
107
  and_return(response)
108
108
  item.delete.should be_false
109
109
  end
@@ -46,7 +46,7 @@ describe NetSuite::Records::SupportCase do
46
46
  let(:response) { NetSuite::Response.new(:success => true, :body => { :title => 'Case title' }) }
47
47
 
48
48
  it 'returns a SupportCase instance populated with the data from the response object' do
49
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::SupportCase, :external_id => 1).and_return(response)
49
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::SupportCase, :external_id => 1], {}).and_return(response)
50
50
  support_case = NetSuite::Records::SupportCase.get(:external_id => 1)
51
51
  support_case.should be_kind_of(NetSuite::Records::SupportCase)
52
52
  support_case.title.should == 'Case title'
@@ -57,7 +57,7 @@ describe NetSuite::Records::SupportCase do
57
57
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
58
58
 
59
59
  it 'raises a RecordNotFound exception' do
60
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::SupportCase, :external_id => 1).and_return(response)
60
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::SupportCase, :external_id => 1], {}).and_return(response)
61
61
  lambda {
62
62
  NetSuite::Records::SupportCase.get(:external_id => 1)
63
63
  }.should raise_error(NetSuite::RecordNotFound,
@@ -74,7 +74,7 @@ describe NetSuite::Records::SupportCase do
74
74
 
75
75
  it 'returns true' do
76
76
  NetSuite::Actions::Add.should_receive(:call).
77
- with(support_case).
77
+ with([support_case], {}).
78
78
  and_return(response)
79
79
  support_case.add.should be_true
80
80
  end
@@ -85,7 +85,7 @@ describe NetSuite::Records::SupportCase do
85
85
 
86
86
  it 'returns false' do
87
87
  NetSuite::Actions::Add.should_receive(:call).
88
- with(support_case).
88
+ with([support_case], {}).
89
89
  and_return(response)
90
90
  support_case.add.should be_false
91
91
  end
@@ -98,7 +98,7 @@ describe NetSuite::Records::SupportCase do
98
98
 
99
99
  it 'returns true' do
100
100
  NetSuite::Actions::Delete.should_receive(:call).
101
- with(support_case).
101
+ with([support_case], {}).
102
102
  and_return(response)
103
103
  support_case.delete.should be_true
104
104
  end
@@ -109,7 +109,7 @@ describe NetSuite::Records::SupportCase do
109
109
 
110
110
  it 'returns false' do
111
111
  NetSuite::Actions::Delete.should_receive(:call).
112
- with(support_case).
112
+ with([support_case], {}).
113
113
  and_return(response)
114
114
  support_case.delete.should be_false
115
115
  end
@@ -121,7 +121,7 @@ describe NetSuite::Records::SupportCase do
121
121
  let(:response) { NetSuite::Response.new(:success => true, :body => { :title => 'Case title' }) }
122
122
 
123
123
  it 'returns true' do
124
- NetSuite::Actions::Update.should_receive(:call).with(NetSuite::Records::SupportCase, :external_id => 1, :title => 'Case title').and_return(response)
124
+ NetSuite::Actions::Update.should_receive(:call).with([NetSuite::Records::SupportCase, :external_id => 1, :title => 'Case title'], {}).and_return(response)
125
125
  support_case = NetSuite::Records::SupportCase.new(:external_id => 1)
126
126
  support_case.update(:title => 'Case title').should be_true
127
127
  end
@@ -131,7 +131,7 @@ describe NetSuite::Records::SupportCase do
131
131
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
132
132
 
133
133
  it 'raises a RecordNotFound exception' do
134
- NetSuite::Actions::Update.should_receive(:call).with(NetSuite::Records::SupportCase, :internal_id => 1, :title => 'Case title').and_return(response)
134
+ NetSuite::Actions::Update.should_receive(:call).with([NetSuite::Records::SupportCase, :internal_id => 1, :title => 'Case title'], {}).and_return(response)
135
135
  support_case = NetSuite::Records::SupportCase.new(:internal_id => 1)
136
136
  support_case.update(:title => 'Case title').should be_false
137
137
  end
@@ -17,7 +17,7 @@ describe NetSuite::Records::Term do
17
17
  let(:response) { NetSuite::Response.new(:success => true, :body => { :name => 'Term 1' }) }
18
18
 
19
19
  it 'returns a Term instance populated with the data from the response object' do
20
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::Term, :external_id => 1).and_return(response)
20
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Term, {:external_id => 1}], {}).and_return(response)
21
21
  term = NetSuite::Records::Term.get(:external_id => 1)
22
22
  term.should be_kind_of(NetSuite::Records::Term)
23
23
  term.name.should eql('Term 1')
@@ -28,7 +28,7 @@ describe NetSuite::Records::Term do
28
28
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
29
29
 
30
30
  it 'raises a RecordNotFound exception' do
31
- NetSuite::Actions::Get.should_receive(:call).with(NetSuite::Records::Term, :external_id => 1).and_return(response)
31
+ NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::Term, {:external_id => 1}], {}).and_return(response)
32
32
  lambda {
33
33
  NetSuite::Records::Term.get(:external_id => 1)
34
34
  }.should raise_error(NetSuite::RecordNotFound,
@@ -46,7 +46,7 @@ describe NetSuite::Records::Term do
46
46
  it 'returns true' do
47
47
  term = NetSuite::Records::Term.new(test_data)
48
48
  NetSuite::Actions::Add.should_receive(:call).
49
- with(term).
49
+ with([term], {}).
50
50
  and_return(response)
51
51
  term.add.should be_true
52
52
  end
@@ -58,7 +58,7 @@ describe NetSuite::Records::Term do
58
58
  it 'returns false' do
59
59
  term = NetSuite::Records::Term.new(test_data)
60
60
  NetSuite::Actions::Add.should_receive(:call).
61
- with(term).
61
+ with([term], {}).
62
62
  and_return(response)
63
63
  term.add.should be_false
64
64
  end
@@ -74,7 +74,7 @@ describe NetSuite::Records::Term do
74
74
  it 'returns true' do
75
75
  term = NetSuite::Records::Term.new(test_data)
76
76
  NetSuite::Actions::Delete.should_receive(:call).
77
- with(term).
77
+ with([term], {}).
78
78
  and_return(response)
79
79
  term.delete.should be_true
80
80
  end
@@ -86,7 +86,7 @@ describe NetSuite::Records::Term do
86
86
  it 'returns false' do
87
87
  term = NetSuite::Records::Term.new(test_data)
88
88
  NetSuite::Actions::Delete.should_receive(:call).
89
- with(term).
89
+ with([term], {}).
90
90
  and_return(response)
91
91
  term.delete.should be_false
92
92
  end