|
65 | 65 | if fin_api_page.has_cars_data?
|
66 | 66 | has_cars_data = true
|
67 | 67 | it 'does not show a no-data message for UID ' + uid do
|
68 |
| - my_fin_no_cars_msg.should be_falsey |
| 68 | + expect(my_fin_no_cars_msg).to be false |
69 | 69 | end
|
70 | 70 |
|
71 | 71 | # API DATA SANITY TESTS
|
72 | 72 | it 'shows an account balance that is equal to the sum of the open transactions for UID ' + uid do
|
73 |
| - fin_api_page.account_balance_str.should eql(fin_api_page.open_transactions_sum_str) |
| 73 | + expect(fin_api_page.account_balance_str).to eql(fin_api_page.open_transactions_sum_str) |
74 | 74 | end
|
75 | 75 | it 'shows an account balance that is equal to the sum of the amount due now plus the amount not yet due for UID ' + uid do
|
76 |
| - BigDecimal.new(fin_api_page.account_balance_str).should eql(BigDecimal.new(fin_api_page.min_amt_due_str) + |
| 76 | + expect(BigDecimal.new(fin_api_page.account_balance_str)).to eql(BigDecimal.new(fin_api_page.min_amt_due_str) + |
77 | 77 | BigDecimal.new(fin_api_page.future_activity_str))
|
78 | 78 | end
|
79 | 79 | if fin_api_page.account_balance >= 0
|
80 | 80 | it 'shows an account balance that is greater than or equal to the minimum amount due now for UID ' + uid do
|
81 |
| - fin_api_page.account_balance.should be >= fin_api_page.min_amt_due |
| 81 | + expect(fin_api_page.account_balance).to be >= fin_api_page.min_amt_due |
82 | 82 | end
|
83 | 83 | it 'shows an account balance that is greater than or equal to the past due amount for UID ' + uid do
|
84 |
| - fin_api_page.account_balance.should be >= fin_api_page.past_due_amt |
| 84 | + expect(fin_api_page.account_balance).to be >= fin_api_page.past_due_amt |
85 | 85 | end
|
86 | 86 | it 'shows an account balance that is greater than or equal to the amount not yet due for UID ' + uid do
|
87 |
| - fin_api_page.account_balance.should be >= fin_api_page.future_activity |
| 87 | + expect(fin_api_page.account_balance).to be >= fin_api_page.future_activity |
88 | 88 | end
|
89 | 89 | it 'shows an account balance that is greater than or equal to the DPP balance for UID ' + uid do
|
90 |
| - fin_api_page.account_balance.should be >= fin_api_page.dpp_balance |
| 90 | + expect(fin_api_page.account_balance).to be >= fin_api_page.dpp_balance |
91 | 91 | end
|
92 | 92 | end
|
93 | 93 |
|
|
99 | 99 | acct_bal = 'Positive'
|
100 | 100 | my_fin_balance_transactions = my_finances_page.visible_transactions_sum_str
|
101 | 101 | it 'shows the open charges for UID ' + uid do
|
102 |
| - my_fin_balance_transactions.should eql(fin_api_page.open_charges_sum_str) |
| 102 | + expect(my_fin_balance_transactions).to eql(fin_api_page.open_charges_sum_str) |
103 | 103 | end
|
104 | 104 | elsif fin_api_page.account_balance == 0
|
105 | 105 | acct_bal = 'Zero'
|
106 | 106 | it 'shows a zero balance message for UID ' + uid do
|
107 |
| - my_fin_zero_bal_text.should be_true |
| 107 | + expect(my_fin_zero_bal_text).to be true |
108 | 108 | end
|
109 | 109 | elsif fin_api_page.account_balance < 0
|
110 | 110 | acct_bal = 'Negative'
|
111 | 111 | it 'shows a credit balance message for UID ' + uid do
|
112 |
| - my_fin_credit_bal_text.should be_true |
| 112 | + expect(my_fin_credit_bal_text).to be true |
113 | 113 | end
|
114 | 114 | end
|
115 | 115 | it 'shows the right account balance for UID ' + uid do
|
116 |
| - my_fin_acct_bal.should eql(fin_api_page.account_balance_str) |
| 116 | + expect(my_fin_acct_bal).to eql(fin_api_page.account_balance_str) |
117 | 117 | end
|
118 | 118 |
|
119 | 119 | # AMOUNT DUE NOW
|
120 | 120 | my_fin_amt_due_label = my_finances_page.amt_due_now_label
|
121 | 121 | if fin_api_page.min_amt_due > 0
|
122 | 122 | amt_due_now = 'Positive'
|
123 | 123 | it 'shows the label Amount Due Now for UID ' + uid do
|
124 |
| - my_fin_amt_due_label.should include('Amount Due Now') |
| 124 | + expect(my_fin_amt_due_label).to include('Amount Due Now') |
125 | 125 | end
|
126 | 126 | elsif fin_api_page.min_amt_due == 0
|
127 | 127 | amt_due_now = 'Zero'
|
128 | 128 | it 'shows the label Amount Due Now for UID ' + uid do
|
129 |
| - my_fin_amt_due_label.should include('Amount Due Now') |
| 129 | + expect(my_fin_amt_due_label).to include('Amount Due Now') |
130 | 130 | end
|
131 | 131 | elsif fin_api_page.min_amt_due < 0
|
132 | 132 | amt_due_now = 'Negative'
|
133 | 133 | it 'shows the label Credit Balance for UID ' + uid do
|
134 |
| - my_fin_amt_due_label.should include('Credit Balance') |
| 134 | + expect(my_fin_amt_due_label).to include('Credit Balance') |
135 | 135 | end
|
136 | 136 | end
|
137 | 137 | my_fin_amt_due_now = my_finances_page.amt_due_now
|
138 | 138 | it 'shows the right amount due now for UID ' + uid do
|
139 |
| - my_fin_amt_due_now.should eql(fin_api_page.min_amt_due_str) |
| 139 | + expect(my_fin_amt_due_now).to eql(fin_api_page.min_amt_due_str) |
140 | 140 | end
|
141 | 141 |
|
142 | 142 | # PAST DUE AMOUNT
|
143 | 143 | if fin_api_page.past_due_amt > 0
|
144 | 144 | has_past_due_amt = true
|
145 | 145 | my_fin_past_due_bal = my_finances_page.past_due_amt
|
146 | 146 | it 'shows the past due amount for UID ' + uid do
|
147 |
| - my_fin_past_due_bal.should eql(fin_api_page.past_due_amt_str) |
| 147 | + expect(my_fin_past_due_bal).to eql(fin_api_page.past_due_amt_str) |
148 | 148 | end
|
149 | 149 | end
|
150 | 150 |
|
|
153 | 153 | has_future_activity = true
|
154 | 154 | my_fin_future_activity = my_finances_page.charges_not_due
|
155 | 155 | it 'shows the charges not yet due for UID ' + uid do
|
156 |
| - my_fin_future_activity.should eql(fin_api_page.future_activity_str) |
| 156 | + expect(my_fin_future_activity).to eql(fin_api_page.future_activity_str) |
157 | 157 | end
|
158 | 158 | end
|
159 | 159 |
|
160 | 160 | # MAKE PAYMENT LINK
|
161 | 161 | my_fin_pmt_link = my_finances_page.make_payment_link?
|
162 | 162 | if fin_api_page.account_balance != 0
|
163 | 163 | it 'shows make payment link for UID ' + uid do
|
164 |
| - my_fin_pmt_link.should be_truthy |
| 164 | + expect(my_fin_pmt_link).to be true |
165 | 165 | end
|
166 | 166 | end
|
167 | 167 |
|
168 | 168 | # LAST STATEMENT BALANCE
|
169 | 169 | my_finances_page.show_last_statement_bal
|
170 | 170 | my_fin_last_bal = my_finances_page.last_statement_balance
|
171 | 171 | it 'shows the right last statement balance for UID ' + uid do
|
172 |
| - my_fin_last_bal.should eql(fin_api_page.last_statement_balance_str) |
| 172 | + expect(my_fin_last_bal).to eql(fin_api_page.last_statement_balance_str) |
173 | 173 | end
|
174 | 174 |
|
175 | 175 | # DPP
|
|
180 | 180 | is_dpp = true
|
181 | 181 | my_fin_dpp_bal = my_finances_page.dpp_balance
|
182 | 182 | it 'shows DPP balance for UID ' + uid do
|
183 |
| - my_fin_dpp_bal.should eql(fin_api_page.dpp_balance_str) |
| 183 | + expect(my_fin_dpp_bal).to eql(fin_api_page.dpp_balance_str) |
184 | 184 | end
|
185 | 185 | it 'shows DPP informational text for UID ' + uid do
|
186 |
| - my_fin_dpp_text.should be_truthy |
| 186 | + expect(my_fin_dpp_text).to be true |
187 | 187 | end
|
188 | 188 | if fin_api_page.dpp_balance > 0
|
189 | 189 | has_dpp_balance = true
|
190 | 190 | my_fin_dpp_install = my_finances_page.dpp_normal_install
|
191 | 191 | it 'shows DPP normal installment amount for UID ' + uid do
|
192 |
| - my_fin_dpp_install.should eql(fin_api_page.dpp_norm_install_amt_str) |
| 192 | + expect(my_fin_dpp_install).to eql(fin_api_page.dpp_norm_install_amt_str) |
193 | 193 | end
|
194 | 194 | else
|
195 | 195 | it 'shows no DPP normal installment amount for UID ' + uid do
|
196 |
| - my_fin_dpp_install_element.should be_falsey |
| 196 | + expect(my_fin_dpp_install_element).to be false |
197 | 197 | end
|
198 | 198 | end
|
199 | 199 | if fin_api_page.is_dpp_past_due?
|
200 | 200 | is_dpp_past_due = true
|
201 | 201 | end
|
202 | 202 | else
|
203 | 203 | it 'shows no DPP balance for UID ' + uid do
|
204 |
| - my_fin_dpp_bal_element.should be_falsey |
| 204 | + expect(my_fin_dpp_bal_element).to be false |
205 | 205 | end
|
206 | 206 | it 'shows no DPP informational text for UID ' + uid do
|
207 |
| - my_fin_dpp_text.should be_falsey |
| 207 | + expect(my_fin_dpp_text).to be false |
208 | 208 | end
|
209 | 209 | end
|
210 | 210 | else
|
211 | 211 | it 'shows a no-data message for UID ' + uid do
|
212 |
| - my_fin_no_cars_msg.should be_truthy |
| 212 | + expect(my_fin_no_cars_msg).to be true |
213 | 213 | end
|
214 | 214 | end
|
215 | 215 |
|
|
0 commit comments