Extract method to render an admin table action

This way it will be easier to change the behavior of all table actions,
like adding ARIA attributes. In the past, when we changed the behavior
of the `link_to` method, we had to change all table action classes.
This commit is contained in:
Javi Martín
2021-08-17 22:21:38 +02:00
parent d7015792ea
commit 6a2c01b119
35 changed files with 184 additions and 134 deletions

View File

@@ -0,0 +1,9 @@
require "rails_helper"
describe Admin::ActionComponent do
it "includes an HTML class for the action" do
render_inline Admin::ActionComponent.new(:edit, double, path: "/")
expect(page).to have_css "a.edit-link"
end
end