From 98fec3bb2f7f87af4863554d1e3932a4cc6fd01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 12 Mar 2025 12:31:41 +0100 Subject: [PATCH] Add missing expectation before checking metadata We weren't checking whether the request creating the proposal had finished before checking the document. That's probably why this test has recently failed on our CI: ``` 1) Documents Metadata download document without metadata Failure/Error: io = URI.parse( "#{app_host}#{polymorphic_path( Document.last.attachment)}" ).open NoMethodError: undefined method `attachment' for nil:NilClass ``` --- spec/system/documents_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/system/documents_spec.rb b/spec/system/documents_spec.rb index 524a559a8..2b3ff51cb 100644 --- a/spec/system/documents_spec.rb +++ b/spec/system/documents_spec.rb @@ -11,9 +11,10 @@ describe "Documents" do fill_in "Full name of the person submitting the proposal", with: "Isabel Garcia" documentable_attach_new_file(file_fixture("logo_with_metadata.pdf")) check "I agree to the Privacy Policy and the Terms and conditions of use" - click_button "Create proposal" + expect(page).to have_content "Proposal created successfully" + io = URI.parse("#{app_host}#{polymorphic_path(Document.last.attachment)}").open reader = PDF::Reader.new(io)