1 parent ba72e87 commit b90b830Copy full SHA for b90b830
1 file changed
test/controllers/pushes_controller_test.rb
@@ -280,6 +280,21 @@ class PushesControllerTest < ActionDispatch::IntegrationTest
280
assert_nil flash[:notice]
281
end
282
283
+ test "access is rate limited after five attempts per push" do
284
+ @push.update!(passphrase: "secret")
285
+
286
+ 5.times do |i|
287
+ post access_push_path(@push), params: {passphrase: "wrong#{i}"}
288
+ assert_response :redirect
289
+ end
290
291
+ post access_push_path(@push), params: {passphrase: "wrong5"}
292
293
294
+ assert_redirected_to passphrase_push_path(@push)
295
+ assert_match(/Too many passphrase attempts/, flash[:alert])
296
297
298
test "notify_emails is rate limited after five bursts per user" do
299
Rails.cache.clear
300
0 commit comments