|
55 | 55 | end |
56 | 56 | end |
57 | 57 |
|
58 | | - # Note: The acceptance tests below are currently failing due to issues with |
59 | | - # the invitation token not being properly preserved in the Devise form. |
60 | | - # This appears to be a limitation of the current Devise invitable setup |
61 | | - # and would require further investigation into the form submission flow. |
62 | 58 | describe "accepting invitation" do |
63 | 59 | let(:volunteer) { create(:volunteer, casa_org: organization, phone_number: nil) } |
64 | 60 | let!(:invitation_token) do |
|
79 | 75 | expect(page).to have_button("Set my password") |
80 | 76 | end |
81 | 77 |
|
82 | | - # These tests are skipped due to form submission issues with the invitation token |
83 | | - xit "allows volunteer to set password and accept invitation" do |
| 78 | + it "allows volunteer to set password and accept invitation" do |
84 | 79 | visit accept_user_invitation_path(invitation_token: invitation_token) |
85 | 80 |
|
86 | 81 | expect(page).to have_text "Set my password" |
|
93 | 88 | volunteer.reload |
94 | 89 | expect(volunteer.invitation_accepted_at).not_to be_nil |
95 | 90 |
|
96 | | - # Should be redirected to the home page or dashboard after accepting |
97 | | - expect(page).to have_current_path(root_path, ignore_query: true) |
| 91 | + # Should be redirected to dashboard after accepting invitation |
| 92 | + expect(page).to have_text("My Cases") |
98 | 93 | end |
99 | 94 |
|
100 | | - xit "shows error when passwords don't match" do |
| 95 | + it "shows error when passwords don't match" do |
101 | 96 | visit accept_user_invitation_path(invitation_token: invitation_token) |
102 | 97 |
|
103 | 98 | fill_in "Password", with: "SecurePassword123!" |
|
111 | 106 | expect(volunteer.invitation_accepted_at).to be_nil |
112 | 107 | end |
113 | 108 |
|
114 | | - xit "shows error when password is too short" do |
| 109 | + it "shows error when password is too short" do |
115 | 110 | visit accept_user_invitation_path(invitation_token: invitation_token) |
116 | 111 |
|
117 | 112 | fill_in "Password", with: "short" |
|
125 | 120 | expect(volunteer.invitation_accepted_at).to be_nil |
126 | 121 | end |
127 | 122 |
|
128 | | - xit "shows error when password is blank" do |
| 123 | + it "shows error when password is blank" do |
129 | 124 | visit accept_user_invitation_path(invitation_token: invitation_token) |
130 | 125 |
|
131 | 126 | fill_in "Password", with: "" |
|
0 commit comments