@@ -66,7 +66,7 @@ def stub_login_code_service(email:, sms:)
66
66
67
67
post ( :create )
68
68
69
- expect ( response ) . to have_http_status ( :unprocessable_entity )
69
+ expect ( response ) . to have_http_status ( :unauthorized )
70
70
expect ( response . body ) . to include ( "Confirm Access" )
71
71
end
72
72
@@ -84,7 +84,7 @@ def stub_login_code_service(email:, sms:)
84
84
85
85
post ( :create )
86
86
87
- expect ( response ) . to have_http_status ( :unprocessable_entity )
87
+ expect ( response ) . to have_http_status ( :unauthorized )
88
88
expect ( response . body ) . to include ( "Confirm Access" )
89
89
expect ( extract_submit_method ( response ) ) . to eq ( "email" )
90
90
end
@@ -98,7 +98,7 @@ def stub_login_code_service(email:, sms:)
98
98
99
99
post ( :create )
100
100
101
- expect ( response ) . to have_http_status ( :unprocessable_entity )
101
+ expect ( response ) . to have_http_status ( :unauthorized )
102
102
expect ( response . body ) . to include ( "Confirm Access" )
103
103
expect ( extract_submit_method ( response ) ) . to eq ( "sms" )
104
104
end
@@ -114,7 +114,7 @@ def stub_login_code_service(email:, sms:)
114
114
115
115
post ( :create )
116
116
117
- expect ( response ) . to have_http_status ( :unprocessable_entity )
117
+ expect ( response ) . to have_http_status ( :unauthorized )
118
118
expect ( response . body ) . to include ( "Confirm Access" )
119
119
expect ( extract_submit_method ( response ) ) . to eq ( "email" )
120
120
end
@@ -128,7 +128,7 @@ def stub_login_code_service(email:, sms:)
128
128
129
129
post ( :create , params : { _sudo : { switch_method : "email" } } )
130
130
131
- expect ( response ) . to have_http_status ( :unprocessable_entity )
131
+ expect ( response ) . to have_http_status ( :unauthorized )
132
132
expect ( response . body ) . to include ( "Confirm Access" )
133
133
expect ( extract_submit_method ( response ) ) . to eq ( "email" )
134
134
end
@@ -154,7 +154,7 @@ def stub_login_code_service(email:, sms:)
154
154
155
155
post ( :create )
156
156
157
- expect ( response ) . to have_http_status ( :unprocessable_entity )
157
+ expect ( response ) . to have_http_status ( :unauthorized )
158
158
expect ( response . body ) . to include ( "Confirm Access" )
159
159
160
160
# If there isn't an explicit user preference we favor WebAuthn
@@ -185,7 +185,7 @@ def stub_login_code_service(email:, sms:)
185
185
186
186
post ( :create , params :)
187
187
188
- expect ( response ) . to have_http_status ( :unprocessable_entity )
188
+ expect ( response ) . to have_http_status ( :unauthorized )
189
189
expect ( response . body ) . to include ( "Confirm Access" )
190
190
191
191
form_params =
@@ -211,7 +211,7 @@ def stub_login_code_service(email:, sms:)
211
211
212
212
post ( :create )
213
213
214
- expect ( response ) . to have_http_status ( :unprocessable_entity )
214
+ expect ( response ) . to have_http_status ( :unauthorized )
215
215
expect ( response . body ) . to include ( "Confirm Access" )
216
216
217
217
login_id = response . parsed_body . css ( "[name='_sudo[login_id]']" ) . sole . attr ( "value" )
@@ -229,7 +229,7 @@ def stub_login_code_service(email:, sms:)
229
229
230
230
post ( :create , params : { _sudo : { login_id : "nope" , submit_method : "email" } } )
231
231
232
- expect ( response ) . to have_http_status ( :unprocessable_entity )
232
+ expect ( response ) . to have_http_status ( :unauthorized )
233
233
expect ( response . body ) . to include ( "Confirm Access" )
234
234
expect ( flash [ :error ] ) . to eq ( "Login has expired. Please try again." )
235
235
end
@@ -413,7 +413,7 @@ def stub_login_service(&)
413
413
}
414
414
)
415
415
416
- expect ( response ) . to have_http_status ( :unprocessable_entity )
416
+ expect ( response ) . to have_http_status ( :unauthorized )
417
417
expect ( response . body ) . to include ( "Confirm Access" )
418
418
expect ( flash [ :error ] ) . to eq ( "Turn it off and on again" )
419
419
end
0 commit comments