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
@@ -10,7 +10,7 @@ describe NetSuite::Records::SalesTaxItem do
10
10
  :exempt, :is_default, :exclude_from_tax_reports, :available, :export,
11
11
  :county, :city, :state, :zip
12
12
  ].each do |field|
13
- sales_tax_item.should have_field(field)
13
+ expect(sales_tax_item).to have_field(field)
14
14
  end
15
15
  end
16
16
 
@@ -19,7 +19,7 @@ describe NetSuite::Records::SalesTaxItem do
19
19
  :tax_type, :tax_agency, :tax_account, :purchase_account, :sale_account,
20
20
  :parent, :nexus_country
21
21
  ].each do |record_ref|
22
- sales_tax_item.should have_record_ref(record_ref)
22
+ expect(sales_tax_item).to have_record_ref(record_ref)
23
23
  end
24
24
  end
25
25
 
@@ -16,12 +16,12 @@ describe NetSuite::Records::ServiceSaleItem do
16
16
  :store_description, :store_detailed_description, :store_display_name, :translations_list, :upc_code, :url_component,
17
17
  :use_marginal_rates, :vsoe_deferral, :vsoe_delivered, :vsoe_permit_discount, :vsoe_price, :vsoe_sop_group
18
18
  ].each do |field|
19
- item.should have_field(field)
19
+ expect(item).to have_field(field)
20
20
  end
21
21
 
22
22
  # TODO there is a probably a more robust way to test this
23
- item.custom_field_list.class.should == NetSuite::Records::CustomFieldList
24
- item.pricing_matrix.class.should == NetSuite::Records::PricingMatrix
23
+ expect(item.custom_field_list.class).to eq(NetSuite::Records::CustomFieldList)
24
+ expect(item.pricing_matrix.class).to eq(NetSuite::Records::PricingMatrix)
25
25
  end
26
26
 
27
27
  it 'has the right record_refs' do
@@ -31,7 +31,7 @@ describe NetSuite::Records::ServiceSaleItem do
31
31
  :quantity_pricing_schedule, :rev_rec_schedule, :sale_unit, :sales_tax_code, :store_display_image,
32
32
  :store_display_thumbnail, :store_item_template, :subsidiary_list, :tax_schedule, :units_type
33
33
  ].each do |record_ref|
34
- item.should have_record_ref(record_ref)
34
+ expect(item).to have_record_ref(record_ref)
35
35
  end
36
36
  end
37
37
 
@@ -40,10 +40,10 @@ 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
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::ServiceSaleItem, :external_id => 20], {}).and_return(response)
44
44
  customer = NetSuite::Records::ServiceSaleItem.get(:external_id => 20)
45
- customer.should be_kind_of(NetSuite::Records::ServiceSaleItem)
46
- customer.item_id.should eql('penguins')
45
+ expect(customer).to be_kind_of(NetSuite::Records::ServiceSaleItem)
46
+ expect(customer.item_id).to eql('penguins')
47
47
  end
48
48
  end
49
49
 
@@ -51,10 +51,10 @@ 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)
55
- lambda {
54
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::ServiceSaleItem, :external_id => 20], {}).and_return(response)
55
+ expect {
56
56
  NetSuite::Records::ServiceSaleItem.get(:external_id => 20)
57
- }.should raise_error(NetSuite::RecordNotFound,
57
+ }.to raise_error(NetSuite::RecordNotFound,
58
58
  /NetSuite::Records::ServiceSaleItem with OPTIONS=(.*) could not be found/)
59
59
  end
60
60
  end
@@ -67,10 +67,10 @@ describe NetSuite::Records::ServiceSaleItem do
67
67
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
68
68
 
69
69
  it 'returns true' do
70
- NetSuite::Actions::Add.should_receive(:call).
70
+ expect(NetSuite::Actions::Add).to receive(:call).
71
71
  with([item], {}).
72
72
  and_return(response)
73
- item.add.should be_truthy
73
+ expect(item.add).to be_truthy
74
74
  end
75
75
  end
76
76
 
@@ -78,10 +78,10 @@ describe NetSuite::Records::ServiceSaleItem do
78
78
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
79
79
 
80
80
  it 'returns false' do
81
- NetSuite::Actions::Add.should_receive(:call).
81
+ expect(NetSuite::Actions::Add).to receive(:call).
82
82
  with([item], {}).
83
83
  and_return(response)
84
- item.add.should be_falsey
84
+ expect(item.add).to be_falsey
85
85
  end
86
86
  end
87
87
  end
@@ -91,10 +91,10 @@ describe NetSuite::Records::ServiceSaleItem do
91
91
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
92
92
 
93
93
  it 'returns true' do
94
- NetSuite::Actions::Delete.should_receive(:call).
94
+ expect(NetSuite::Actions::Delete).to receive(:call).
95
95
  with([item], {}).
96
96
  and_return(response)
97
- item.delete.should be_truthy
97
+ expect(item.delete).to be_truthy
98
98
  end
99
99
  end
100
100
 
@@ -102,10 +102,10 @@ describe NetSuite::Records::ServiceSaleItem do
102
102
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
103
103
 
104
104
  it 'returns false' do
105
- NetSuite::Actions::Delete.should_receive(:call).
105
+ expect(NetSuite::Actions::Delete).to receive(:call).
106
106
  with([item], {}).
107
107
  and_return(response)
108
- item.delete.should be_falsey
108
+ expect(item.delete).to be_falsey
109
109
  end
110
110
  end
111
111
  end
@@ -121,13 +121,13 @@ describe NetSuite::Records::ServiceSaleItem do
121
121
  'listAcct:itemId' => 'penguins',
122
122
  'listAcct:isOnline' => true
123
123
  }
124
- item.to_record.should eql(record)
124
+ expect(item.to_record).to eql(record)
125
125
  end
126
126
  end
127
127
 
128
128
  describe '#record_type' do
129
129
  it 'returns a string of the SOAP type' do
130
- item.record_type.should eql('listAcct:ServiceSaleItem')
130
+ expect(item.record_type).to eql('listAcct:ServiceSaleItem')
131
131
  end
132
132
  end
133
133
 
@@ -8,7 +8,7 @@ describe NetSuite::Records::ShipAddress do
8
8
  :ship_attention, :ship_addressee, :ship_phone, :ship_addr1, :ship_addr2, :ship_addr3,
9
9
  :ship_city, :ship_state, :ship_zip, :ship_country, :ship_is_residential
10
10
  ].each do |field|
11
- ship_address.should have_field(field)
11
+ expect(ship_address).to have_field(field)
12
12
  end
13
13
  end
14
14
 
@@ -23,13 +23,13 @@ describe NetSuite::Records::ShipAddress do
23
23
  'platformCommon:shipAttention' => 'Mr. Smith',
24
24
  'platformCommon:shipZip' => '90007'
25
25
  }
26
- ship_address.to_record.should eql(record)
26
+ expect(ship_address.to_record).to eql(record)
27
27
  end
28
28
  end
29
29
 
30
30
  describe '#record_type' do
31
31
  it 'returns a string of the SOAP record type' do
32
- ship_address.record_type.should eql('platformCommon:ShipAddress')
32
+ expect(ship_address.record_type).to eql('platformCommon:ShipAddress')
33
33
  end
34
34
  end
35
35
 
@@ -10,7 +10,7 @@ describe NetSuite::Records::SiteCategory do
10
10
  :search_keywords, :sitemap_priority, :store_detailed_description,
11
11
  :translations_list, :url_component
12
12
  ].each do |field|
13
- site_category.should have_field(field)
13
+ expect(site_category).to have_field(field)
14
14
  end
15
15
  end
16
16
 
@@ -19,7 +19,7 @@ describe NetSuite::Records::SiteCategory do
19
19
  :category_list_layout, :correlated_items_list_layout, :item_list_layout, :parent_category,
20
20
  :related_items_list_layout, :store_display_image, :store_display_thumbnail, :website
21
21
  ].each do |record_ref|
22
- site_category.should have_record_ref(record_ref)
22
+ expect(site_category).to have_record_ref(record_ref)
23
23
  end
24
24
  end
25
25
 
@@ -28,10 +28,10 @@ describe NetSuite::Records::SiteCategory do
28
28
  let(:response) { NetSuite::Response.new(:success => true, :body => { :url_component => 'some url' }) }
29
29
 
30
30
  it 'returns a SiteCategory instance populated with the data from the response object' do
31
- NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::SiteCategory, :external_id => 1], {}).and_return(response)
31
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::SiteCategory, :external_id => 1], {}).and_return(response)
32
32
  site_category = NetSuite::Records::SiteCategory.get(:external_id => 1)
33
- site_category.should be_kind_of(NetSuite::Records::SiteCategory)
34
- site_category.url_component.should == 'some url'
33
+ expect(site_category).to be_kind_of(NetSuite::Records::SiteCategory)
34
+ expect(site_category.url_component).to eq('some url')
35
35
  end
36
36
  end
37
37
 
@@ -39,10 +39,10 @@ describe NetSuite::Records::SiteCategory do
39
39
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
40
40
 
41
41
  it 'raises a RecordNotFound exception' do
42
- NetSuite::Actions::Get.should_receive(:call).with([NetSuite::Records::SiteCategory, :external_id => 1], {}).and_return(response)
43
- lambda {
42
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::SiteCategory, :external_id => 1], {}).and_return(response)
43
+ expect {
44
44
  NetSuite::Records::SiteCategory.get(:external_id => 1)
45
- }.should raise_error(NetSuite::RecordNotFound,
45
+ }.to raise_error(NetSuite::RecordNotFound,
46
46
  /NetSuite::Records::SiteCategory with OPTIONS=(.*) could not be found/)
47
47
  end
48
48
  end
@@ -12,14 +12,14 @@ describe NetSuite::Records::Subsidiary do
12
12
  :federal_id_number, :addr_language, :non_consol, :consol, :ship_address1,
13
13
  :ship_address2, :ship_city, :ship_state, :ship_country, :ship_zip,
14
14
  :state1_tax_number, :ssn_or_tin, :inbound_email ].each do |field|
15
- subsidiary.should have_field(field)
15
+ expect(subsidiary).to have_field(field)
16
16
  end
17
17
  end
18
18
 
19
19
  it 'has all the right record refs' do
20
20
  [ :check_layout, :inter_co_account, :parent, :logo, :page_logo,
21
21
  :fiscal_calendar, :tax_fiscal_calendar, :currency ].each do |record_ref|
22
- subsidiary.should have_record_ref(record_ref)
22
+ expect(subsidiary).to have_record_ref(record_ref)
23
23
  end
24
24
  end
25
25
  end
@@ -9,7 +9,7 @@ describe NetSuite::Records::SupportCase do
9
9
  :internal_only, :title, :case_number, :start_date, :email, :phone, :inbound_email,
10
10
  :is_inactive, :help_desk
11
11
  ].each do |field|
12
- support_case.should have_field(field)
12
+ expect(support_case).to have_field(field)
13
13
  end
14
14
  end
15
15
 
@@ -17,7 +17,7 @@ describe NetSuite::Records::SupportCase do
17
17
  [
18
18
  :custom_form, :company, :contact, :issue, :status, :priority, :origin, :category, :assigned
19
19
  ].each do |record_ref|
20
- support_case.should have_record_ref(record_ref)
20
+ expect(support_case).to have_record_ref(record_ref)
21
21
  end
22
22
  end
23
23
 
@@ -30,14 +30,14 @@ describe NetSuite::Records::SupportCase do
30
30
  }
31
31
  }
32
32
  support_case.custom_field_list = attributes
33
- support_case.custom_field_list.should be_kind_of(NetSuite::Records::CustomFieldList)
34
- support_case.custom_field_list.custom_fields.length.should eql(1)
33
+ expect(support_case.custom_field_list).to be_kind_of(NetSuite::Records::CustomFieldList)
34
+ expect(support_case.custom_field_list.custom_fields.length).to eql(1)
35
35
  end
36
36
 
37
37
  it 'can be set from a CustomFieldList object' do
38
38
  custom_field_list = NetSuite::Records::CustomFieldList.new
39
39
  support_case.custom_field_list = custom_field_list
40
- support_case.custom_field_list.should eql(custom_field_list)
40
+ expect(support_case.custom_field_list).to eql(custom_field_list)
41
41
  end
42
42
  end
43
43
 
@@ -46,10 +46,10 @@ 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
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::SupportCase, :external_id => 1], {}).and_return(response)
50
50
  support_case = NetSuite::Records::SupportCase.get(:external_id => 1)
51
- support_case.should be_kind_of(NetSuite::Records::SupportCase)
52
- support_case.title.should == 'Case title'
51
+ expect(support_case).to be_kind_of(NetSuite::Records::SupportCase)
52
+ expect(support_case.title).to eq('Case title')
53
53
  end
54
54
  end
55
55
 
@@ -57,10 +57,10 @@ 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)
61
- lambda {
60
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::SupportCase, :external_id => 1], {}).and_return(response)
61
+ expect {
62
62
  NetSuite::Records::SupportCase.get(:external_id => 1)
63
- }.should raise_error(NetSuite::RecordNotFound,
63
+ }.to raise_error(NetSuite::RecordNotFound,
64
64
  /NetSuite::Records::SupportCase with OPTIONS=(.*) could not be found/)
65
65
  end
66
66
  end
@@ -73,10 +73,10 @@ describe NetSuite::Records::SupportCase do
73
73
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
74
74
 
75
75
  it 'returns true' do
76
- NetSuite::Actions::Add.should_receive(:call).
76
+ expect(NetSuite::Actions::Add).to receive(:call).
77
77
  with([support_case], {}).
78
78
  and_return(response)
79
- support_case.add.should be_truthy
79
+ expect(support_case.add).to be_truthy
80
80
  end
81
81
  end
82
82
 
@@ -84,10 +84,10 @@ describe NetSuite::Records::SupportCase do
84
84
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
85
85
 
86
86
  it 'returns false' do
87
- NetSuite::Actions::Add.should_receive(:call).
87
+ expect(NetSuite::Actions::Add).to receive(:call).
88
88
  with([support_case], {}).
89
89
  and_return(response)
90
- support_case.add.should be_falsey
90
+ expect(support_case.add).to be_falsey
91
91
  end
92
92
  end
93
93
  end
@@ -97,10 +97,10 @@ describe NetSuite::Records::SupportCase do
97
97
  let(:response) { NetSuite::Response.new(:success => true, :body => { :internal_id => '1' }) }
98
98
 
99
99
  it 'returns true' do
100
- NetSuite::Actions::Delete.should_receive(:call).
100
+ expect(NetSuite::Actions::Delete).to receive(:call).
101
101
  with([support_case], {}).
102
102
  and_return(response)
103
- support_case.delete.should be_truthy
103
+ expect(support_case.delete).to be_truthy
104
104
  end
105
105
  end
106
106
 
@@ -108,10 +108,10 @@ describe NetSuite::Records::SupportCase do
108
108
  let(:response) { NetSuite::Response.new(:success => false, :body => {}) }
109
109
 
110
110
  it 'returns false' do
111
- NetSuite::Actions::Delete.should_receive(:call).
111
+ expect(NetSuite::Actions::Delete).to receive(:call).
112
112
  with([support_case], {}).
113
113
  and_return(response)
114
- support_case.delete.should be_falsey
114
+ expect(support_case.delete).to be_falsey
115
115
  end
116
116
  end
117
117
  end
@@ -121,9 +121,9 @@ 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
+ expect(NetSuite::Actions::Update).to 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
- support_case.update(:title => 'Case title').should be_truthy
126
+ expect(support_case.update(:title => 'Case title')).to be_truthy
127
127
  end
128
128
  end
129
129
 
@@ -131,9 +131,9 @@ 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
+ expect(NetSuite::Actions::Update).to 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
- support_case.update(:title => 'Case title').should be_falsey
136
+ expect(support_case.update(:title => 'Case title')).to be_falsey
137
137
  end
138
138
  end
139
139
  end
@@ -142,7 +142,7 @@ describe NetSuite::Records::SupportCase do
142
142
  let(:support_case) { NetSuite::Records::SupportCase.new(:title => 'Case title') }
143
143
 
144
144
  it 'returns a hash of attributes that can be used in a SOAP request' do
145
- support_case.to_record.should eql({
145
+ expect(support_case.to_record).to eql({
146
146
  'listSupport:title' => 'Case title'
147
147
  })
148
148
  end
@@ -150,7 +150,7 @@ describe NetSuite::Records::SupportCase do
150
150
 
151
151
  describe '#record_type' do
152
152
  it 'returns a string type for the record to be used in a SOAP request' do
153
- support_case.record_type.should eql('listSupport:SupportCase')
153
+ expect(support_case.record_type).to eql('listSupport:SupportCase')
154
154
  end
155
155
  end
156
156
 
@@ -5,7 +5,7 @@ describe NetSuite::Records::TaxType do
5
5
 
6
6
  it 'has all the right fields' do
7
7
  [ :description, :name ].each do |field|
8
- tax_type.should have_field(field)
8
+ expect(tax_type).to have_field(field)
9
9
  end
10
10
  end
11
11
  end
@@ -8,7 +8,7 @@ describe NetSuite::Records::Term do
8
8
  :name, :date_driven, :days_until_next_due, :discount_percent, :days_until_expiry, :day_of_month_net_due,
9
9
  :due_next_month_if_within_days, :discount_percent_date_driven, :day_discount_expires, :preferred, :is_inactive
10
10
  ].each do |field|
11
- term.should have_field(field)
11
+ expect(term).to have_field(field)
12
12
  end
13
13
  end
14
14
 
@@ -17,10 +17,10 @@ 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
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Term, {:external_id => 1}], {}).and_return(response)
21
21
  term = NetSuite::Records::Term.get(:external_id => 1)
22
- term.should be_kind_of(NetSuite::Records::Term)
23
- term.name.should eql('Term 1')
22
+ expect(term).to be_kind_of(NetSuite::Records::Term)
23
+ expect(term.name).to eql('Term 1')
24
24
  end
25
25
  end
26
26
 
@@ -28,10 +28,10 @@ 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)
32
- lambda {
31
+ expect(NetSuite::Actions::Get).to receive(:call).with([NetSuite::Records::Term, {:external_id => 1}], {}).and_return(response)
32
+ expect {
33
33
  NetSuite::Records::Term.get(:external_id => 1)
34
- }.should raise_error(NetSuite::RecordNotFound,
34
+ }.to raise_error(NetSuite::RecordNotFound,
35
35
  /NetSuite::Records::Term with OPTIONS=(.*) could not be found/)
36
36
  end
37
37
  end
@@ -45,10 +45,10 @@ describe NetSuite::Records::Term do
45
45
 
46
46
  it 'returns true' do
47
47
  term = NetSuite::Records::Term.new(test_data)
48
- NetSuite::Actions::Add.should_receive(:call).
48
+ expect(NetSuite::Actions::Add).to receive(:call).
49
49
  with([term], {}).
50
50
  and_return(response)
51
- term.add.should be_truthy
51
+ expect(term.add).to be_truthy
52
52
  end
53
53
  end
54
54
 
@@ -57,10 +57,10 @@ describe NetSuite::Records::Term do
57
57
 
58
58
  it 'returns false' do
59
59
  term = NetSuite::Records::Term.new(test_data)
60
- NetSuite::Actions::Add.should_receive(:call).
60
+ expect(NetSuite::Actions::Add).to receive(:call).
61
61
  with([term], {}).
62
62
  and_return(response)
63
- term.add.should be_falsey
63
+ expect(term.add).to be_falsey
64
64
  end
65
65
  end
66
66
  end
@@ -73,10 +73,10 @@ describe NetSuite::Records::Term do
73
73
 
74
74
  it 'returns true' do
75
75
  term = NetSuite::Records::Term.new(test_data)
76
- NetSuite::Actions::Delete.should_receive(:call).
76
+ expect(NetSuite::Actions::Delete).to receive(:call).
77
77
  with([term], {}).
78
78
  and_return(response)
79
- term.delete.should be_truthy
79
+ expect(term.delete).to be_truthy
80
80
  end
81
81
  end
82
82
 
@@ -85,10 +85,10 @@ describe NetSuite::Records::Term do
85
85
 
86
86
  it 'returns false' do
87
87
  term = NetSuite::Records::Term.new(test_data)
88
- NetSuite::Actions::Delete.should_receive(:call).
88
+ expect(NetSuite::Actions::Delete).to receive(:call).
89
89
  with([term], {}).
90
90
  and_return(response)
91
- term.delete.should be_falsey
91
+ expect(term.delete).to be_falsey
92
92
  end
93
93
  end
94
94
  end