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:
9
spec/components/admin/action_component_spec.rb
Normal file
9
spec/components/admin/action_component_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user