Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class extends Controller {
event.keyCode == keycodes.space ||
event.keyCode == keycodes.enter) {

if (event.target.href) {
if (event.target.closest("a[href], button, input[type='submit']")) {
return;
}

Expand Down
11 changes: 11 additions & 0 deletions spec/features/orders_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
)
end

scenario "clicking destroy does not navigate to show page", js: true do
create(:order)

visit admin_orders_path
dismiss_confirm do
click_on t("administrate.actions.destroy")
end

expect(page).to have_current_path(admin_orders_path)
end

scenario "cannot delete because associated payment", js: true do
create(:payment, order: create(:order))

Expand Down