Skip to content

Commit 81f0419

Browse files
committed
Merge pull request #3079 from pfarestveit/rspec-upgrade-fixes
CLC-4376: fix Selenium rspec syntax for upgrade
2 parents d67f823 + 7aefe0f commit 81f0419

7 files changed

+193
-194
lines changed

spec/ui_selenium/authentication_deep_linking_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
cal_net_auth_page.logout_conf_heading_element.when_visible(timeout=WebDriverUtils.page_load_timeout)
5050
@driver.get(semester_page)
5151
cal_net_auth_page.login(user, password)
52-
@driver.current_url.should eql(semester_page)
52+
expect(@driver.current_url).to eql(semester_page)
5353
end
5454

5555
it 'works for My Campus' do

spec/ui_selenium/my_dashboard_google_live_updates_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@
5959
context 'for Google mail' do
6060

6161
it 'shows a user an updated count of email messages' do
62-
@dashboard.email_count.should eql((@initial_mail_count + 1).to_s)
62+
expect(@dashboard.email_count).to eql((@initial_mail_count + 1).to_s)
6363
end
6464

6565
it 'shows a user a snippet of a new email message' do
6666
@dashboard.show_unread_email
67-
@dashboard.email_one_sender.should eql("me")
68-
@dashboard.email_one_subject.should eql('Test email ' + id)
69-
@dashboard.email_one_summary.should eql('This is the subject of test email ' + id)
67+
expect(@dashboard.email_one_sender).to eql("me")
68+
expect(@dashboard.email_one_subject).to eql('Test email ' + id)
69+
expect(@dashboard.email_one_summary).to eql('This is the subject of test email ' + id)
7070
end
7171
end
7272

@@ -75,13 +75,13 @@
7575
it 'shows a user an updated count of tasks' do
7676
@to_do_card.click_unscheduled_tasks_tab
7777
@to_do_card.unsched_task_count_element.when_visible(timeout=WebDriverUtils.page_load_timeout)
78-
@to_do_card.unsched_task_count.should eql((@initial_task_count + 1).to_s)
78+
expect(@to_do_card.unsched_task_count).to eql((@initial_task_count + 1).to_s)
7979
end
8080

8181
it 'shows a user the content of a new task' do
8282
@to_do_card.click_unscheduled_tasks_tab
83-
@to_do_card.unsched_task_one_title.should eql('Test task ' + id)
84-
@to_do_card.unsched_task_one_date.should eql(Date.today.strftime("%m/%d"))
83+
expect(@to_do_card.unsched_task_one_title).to eql('Test task ' + id)
84+
expect(@to_do_card.unsched_task_one_date).to eql(Date.today.strftime("%m/%d"))
8585
end
8686
end
8787
end

spec/ui_selenium/my_dashboard_google_tasks_spec.rb

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

spec/ui_selenium/my_finances_data_acct_summary_spec.rb

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -65,29 +65,29 @@
6565
if fin_api_page.has_cars_data?
6666
has_cars_data = true
6767
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
6969
end
7070

7171
# API DATA SANITY TESTS
7272
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)
7474
end
7575
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) +
7777
BigDecimal.new(fin_api_page.future_activity_str))
7878
end
7979
if fin_api_page.account_balance >= 0
8080
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
8282
end
8383
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
8585
end
8686
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
8888
end
8989
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
9191
end
9292
end
9393

@@ -99,52 +99,52 @@
9999
acct_bal = 'Positive'
100100
my_fin_balance_transactions = my_finances_page.visible_transactions_sum_str
101101
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)
103103
end
104104
elsif fin_api_page.account_balance == 0
105105
acct_bal = 'Zero'
106106
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
108108
end
109109
elsif fin_api_page.account_balance < 0
110110
acct_bal = 'Negative'
111111
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
113113
end
114114
end
115115
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)
117117
end
118118

119119
# AMOUNT DUE NOW
120120
my_fin_amt_due_label = my_finances_page.amt_due_now_label
121121
if fin_api_page.min_amt_due > 0
122122
amt_due_now = 'Positive'
123123
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')
125125
end
126126
elsif fin_api_page.min_amt_due == 0
127127
amt_due_now = 'Zero'
128128
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')
130130
end
131131
elsif fin_api_page.min_amt_due < 0
132132
amt_due_now = 'Negative'
133133
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')
135135
end
136136
end
137137
my_fin_amt_due_now = my_finances_page.amt_due_now
138138
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)
140140
end
141141

142142
# PAST DUE AMOUNT
143143
if fin_api_page.past_due_amt > 0
144144
has_past_due_amt = true
145145
my_fin_past_due_bal = my_finances_page.past_due_amt
146146
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)
148148
end
149149
end
150150

@@ -153,23 +153,23 @@
153153
has_future_activity = true
154154
my_fin_future_activity = my_finances_page.charges_not_due
155155
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)
157157
end
158158
end
159159

160160
# MAKE PAYMENT LINK
161161
my_fin_pmt_link = my_finances_page.make_payment_link?
162162
if fin_api_page.account_balance != 0
163163
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
165165
end
166166
end
167167

168168
# LAST STATEMENT BALANCE
169169
my_finances_page.show_last_statement_bal
170170
my_fin_last_bal = my_finances_page.last_statement_balance
171171
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)
173173
end
174174

175175
# DPP
@@ -180,36 +180,36 @@
180180
is_dpp = true
181181
my_fin_dpp_bal = my_finances_page.dpp_balance
182182
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)
184184
end
185185
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
187187
end
188188
if fin_api_page.dpp_balance > 0
189189
has_dpp_balance = true
190190
my_fin_dpp_install = my_finances_page.dpp_normal_install
191191
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)
193193
end
194194
else
195195
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
197197
end
198198
end
199199
if fin_api_page.is_dpp_past_due?
200200
is_dpp_past_due = true
201201
end
202202
else
203203
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
205205
end
206206
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
208208
end
209209
end
210210
else
211211
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
213213
end
214214
end
215215

0 commit comments

Comments
 (0)