From b035e3cd26180c84c3657b6f9e66a7f288010b14 Mon Sep 17 00:00:00 2001 From: benjamin wil Date: Mon, 21 Feb 2022 14:13:17 -0800 Subject: [PATCH] Fix another order-dependent test failure Very occasionally, this test fails due to `Precious::App` settings set in previous tests. You can reproduce this failure using this seed: bundle exec rake TESTOPTS="--seed=42898" --- test/test_app.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/test_app.rb b/test/test_app.rb index bcb8729e..fb2d2d57 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -413,7 +413,15 @@ EOF test "uploading is not allowed unless explicitly enabled" do temp_upload_file = Tempfile.new(['upload', '.file']) << 'abc' temp_upload_file.close - post "/gollum/upload_file", :file => Rack::Test::UploadedFile.new(::File.open(temp_upload_file)) + + Precious::App.set( + :wiki_options, + {allow_uploads: false, per_page_uploads: false} + ) + + post '/gollum/upload_file', + file: Rack::Test::UploadedFile.new(File.open(temp_upload_file)) + assert_equal 405, last_response.status end