Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec refactor #11853

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spec/system/admin/orders_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,12 @@

context "can bulk print invoices" do
def extract_pdf_content
pdf_href = page.all('a').pluck('href')
page.find(class: "button", text: "VIEW FILE").click
invoice_file_number = pdf_href[0][45..59]
invoice_path = "tmp/invoices/#{invoice_file_number}.pdf"
reader = PDF::Reader.new(invoice_path)
# Extract last part of invoice URL
link = page.find(class: "button", text: "VIEW FILE")
filename = link[:href].match %r{/invoices/.*}

# Load invoice temp file directly instead of downloading
reader = PDF::Reader.new("tmp/#{filename}.pdf")
reader.pages.map(&:text)
end

Expand Down
Loading