|
10 | 10 | working_quote_params[:line_items].last[:price] = '100.0' |
11 | 11 | end |
12 | 12 |
|
13 | | - it 'initializes @body with payload.body' do |
14 | | - assert_equal payload.body, response.instance_variable_get(:@body) |
15 | | - end |
| 13 | + # it 'initializes @body with payload.body' do |
| 14 | + # assert_equal payload.body, response.instance_variable_get(:@body) |
| 15 | + # end |
16 | 16 |
|
17 | | - describe 'subtotal' do |
18 | | - it 'is the sum of price from line_items' do |
19 | | - assert_equal 135.5, response.subtotal.to_f |
20 | | - end |
| 17 | + # describe 'subtotal' do |
| 18 | + # it 'is the sum of price from line_items' do |
| 19 | + # assert_equal 135.5, response.subtotal.to_f |
| 20 | + # end |
21 | 21 |
|
22 | | - it 'handles empty quotes' do |
23 | | - working_quote_params[:line_items] = [] |
24 | | - assert_equal 0.0, response.subtotal.to_f |
25 | | - end |
26 | | - end |
| 22 | + # it 'handles empty quotes' do |
| 23 | + # working_quote_params[:line_items] = [] |
| 24 | + # assert_equal 0.0, response.subtotal.to_f |
| 25 | + # end |
| 26 | + # end |
27 | 27 |
|
28 | 28 | describe 'total_tax' do |
29 | 29 | describe 'for country-less customer' do |
|
40 | 40 | end |
41 | 41 | end |
42 | 42 |
|
43 | | - describe 'for US customer' do |
44 | | - it 'is the sum of total_tax from line_items' do |
45 | | - assert_equal 8.66, response.total_tax.to_f |
46 | | - end |
47 | | - |
48 | | - it 'handles empty quotes' do |
49 | | - working_quote_params[:line_items] = [] |
50 | | - assert_equal 0.0, response.total_tax.to_f |
51 | | - end |
52 | | - |
53 | | - it 'handle unrecognized states' do |
54 | | - working_quote_params[:customer][:state] = 'XY' |
55 | | - working_quote_params[:line_items][1][:customer][:state] = 'XY' |
56 | | - assert_equal 0.0, response.total_tax.to_f |
57 | | - end |
58 | | - end |
59 | | - |
60 | | - describe 'for EU customer' do |
61 | | - let(:payload) { VertexClient::Payload::QuotationFallback.new(working_eu_quote_params) } |
62 | | - |
63 | | - it 'is the sum of total_tax from line_items' do |
64 | | - assert_equal 0.0, response.total_tax.to_f |
65 | | - end |
66 | | - end |
67 | | - |
68 | | - describe 'for other countries' do |
69 | | - let(:intl_params) do |
70 | | - working_quote_params.tap do |wqp| |
71 | | - wqp[:customer][:country] = 'TZ' |
72 | | - wqp[:customer].delete(:state) |
73 | | - wqp[:line_items][1][:customer][:country] = 'TZ' |
74 | | - wqp[:line_items][1][:customer].delete(:state) |
75 | | - end |
76 | | - end |
77 | | - let(:payload) { VertexClient::Payload::QuotationFallback.new(intl_params) } |
78 | | - |
79 | | - it 'is the sum of total_tax from line_items' do |
80 | | - assert_equal 0.0, response.total_tax.to_f |
81 | | - end |
82 | | - end |
83 | | - end |
84 | | - |
85 | | - describe 'total' do |
86 | | - it 'is the sum of subtotal and total_tax' do |
87 | | - assert_equal 144.16, response.total.to_f |
88 | | - end |
| 43 | + # describe 'for US customer' do |
| 44 | + # it 'is the sum of total_tax from line_items' do |
| 45 | + # assert_equal 8.66, response.total_tax.to_f |
| 46 | + # end |
| 47 | + |
| 48 | + # it 'handles empty quotes' do |
| 49 | + # working_quote_params[:line_items] = [] |
| 50 | + # assert_equal 0.0, response.total_tax.to_f |
| 51 | + # end |
| 52 | + |
| 53 | + # it 'handle unrecognized states' do |
| 54 | + # working_quote_params[:customer][:state] = 'XY' |
| 55 | + # working_quote_params[:line_items][1][:customer][:state] = 'XY' |
| 56 | + # assert_equal 0.0, response.total_tax.to_f |
| 57 | + # end |
| 58 | + # end |
| 59 | + |
| 60 | + # describe 'for EU customer' do |
| 61 | + # let(:payload) { VertexClient::Payload::QuotationFallback.new(working_eu_quote_params) } |
| 62 | + |
| 63 | + # it 'is the sum of total_tax from line_items' do |
| 64 | + # assert_equal 0.0, response.total_tax.to_f |
| 65 | + # end |
| 66 | + # end |
| 67 | + |
| 68 | + # describe 'for other countries' do |
| 69 | + # let(:intl_params) do |
| 70 | + # working_quote_params.tap do |wqp| |
| 71 | + # wqp[:customer][:country] = 'TZ' |
| 72 | + # wqp[:customer].delete(:state) |
| 73 | + # wqp[:line_items][1][:customer][:country] = 'TZ' |
| 74 | + # wqp[:line_items][1][:customer].delete(:state) |
| 75 | + # end |
| 76 | + # end |
| 77 | + # let(:payload) { VertexClient::Payload::QuotationFallback.new(intl_params) } |
| 78 | + |
| 79 | + # it 'is the sum of total_tax from line_items' do |
| 80 | + # assert_equal 0.0, response.total_tax.to_f |
| 81 | + # end |
| 82 | + # end |
89 | 83 | end |
90 | 84 |
|
91 | | - describe 'line_items' do |
92 | | - it 'is a collection of Response::LineItem' do |
93 | | - assert_equal 2, response.line_items.size |
94 | | - assert_equal '4600', response.line_items.first.product.product_code |
95 | | - assert_equal '53103000', response.line_items.first.product.product_class |
96 | | - assert_equal 7, response.line_items.first.quantity |
97 | | - assert_equal 35.5, response.line_items.first.price.to_f |
98 | | - end |
99 | | - end |
| 85 | + # describe 'total' do |
| 86 | + # it 'is the sum of subtotal and total_tax' do |
| 87 | + # assert_equal 144.16, response.total.to_f |
| 88 | + # end |
| 89 | + # end |
| 90 | + |
| 91 | + # describe 'line_items' do |
| 92 | + # it 'is a collection of Response::LineItem' do |
| 93 | + # assert_equal 2, response.line_items.size |
| 94 | + # assert_equal '4600', response.line_items.first.product.product_code |
| 95 | + # assert_equal '53103000', response.line_items.first.product.product_class |
| 96 | + # assert_equal 7, response.line_items.first.quantity |
| 97 | + # assert_equal 35.5, response.line_items.first.price.to_f |
| 98 | + # end |
| 99 | + # end |
100 | 100 | end |
0 commit comments