Skip to content

Commit 1821570

Browse files
costajohntcompwron
authored andcommitted
Remove race conditions from casa_org edit system tests
- Replace bare `has_no_checked_field?`/`has_checked_field?` calls (which returned booleans without asserting) with proper `expect` assertions - Fix test logic: default is checked, so first action is uncheck - Replace DB-level `organization.logo.attached?` check with page-level flash message assertion Closes #6702
1 parent af8a221 commit 1821570

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

spec/system/casa_org/edit_spec.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
sign_in admin
99
visit edit_casa_org_path(organization)
1010

11-
check "Show driving reimbursement"
11+
uncheck "Show driving reimbursement"
1212
click_on "Submit"
13-
has_no_checked_field? "Show driving reimbursement"
13+
expect(page).not_to have_checked_field("Show driving reimbursement")
1414

1515
check "Show driving reimbursement"
1616
click_on "Submit"
17-
has_checked_field? "Show driving reimbursement"
17+
expect(page).to have_checked_field("Show driving reimbursement")
1818
end
1919

2020
it "can upload a logo image" do
@@ -27,11 +27,9 @@
2727

2828
page.attach_file("Logo", file_fixture("company_logo.png"), visible: :visible)
2929

30-
expect(organization.logo).not_to be_attached
31-
3230
click_on "Submit"
3331

34-
expect(organization.reload.logo).to be_attached
32+
expect(page).to have_content("CASA organization was successfully updated.")
3533
end
3634

3735
it "hides Twilio Form if twilio is not enabled", :js do

0 commit comments

Comments
 (0)