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

Reproduce missing refund log entry bug #5006

Closed
Closed
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
20 changes: 19 additions & 1 deletion backend/spec/features/admin/orders/new_refund_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,25 @@
click_button 'Refund'
end
expect(page).to have_content 'Refund has been successfully created!'
expect(page).to have_selector 'td', text: amount
within 'tr[data-hook="refunds_row"]' do
expect(page).to have_selector 'td', text: amount
end
end

it 'creates a new log entry for a refund', pending: 'This is pending because currently no log entry is created for this refund.' do
visit spree.new_admin_order_payment_refund_path(order, payment)
expect(page).not_to have_selector 'td', text: amount
within '.new_refund' do
fill_in 'refund_amount', with: amount
select reason.name, from: 'Reason'
click_button 'Refund'
end
expect(page).to have_content 'Refund has been successfully created!'
within 'tr[data-hook="payments_row"]' do
payment_number = find_all('td').first.text
click_on payment_number
expect(page).to have_selector 'tr.log_entry'
end
end

it 'disables the button at submit' do
Expand Down