Skip to content

Commit

Permalink
fix: actions arguments (#3144)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Aug 16, 2024
1 parent 14f0459 commit 0874744
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/components/avo/actions_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def render_divider(action)
end

def render_action_link(action)
link_to action.link_arguments(resource: @resource).first,
link_to action.link_arguments(resource: @resource, arguments: action.arguments).first,
data: action_data_attributes(action),
title: action.action_name,
class: action_css_class(action) do
Expand Down
13 changes: 13 additions & 0 deletions spec/system/avo/actions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,19 @@
end
end

describe "arguments" do
it "access to arguments" do
visit avo.resources_fish_index_path

open_panel_action(action_name: "Dummy action")

run_action

expect(page).not_to have_text "Sure, I love 🥑"
expect(page).to have_text "I love 🥑"
end
end

# let!(:roles) { { admin: false, manager: false, writer: false } }
# let!(:user) { create :user, active: true, roles: roles }

Expand Down

0 comments on commit 0874744

Please sign in to comment.