Extract component for restore and hide actions
By doing so, we remove a lot of duplication.
This commit is contained in:
14
spec/components/admin/hidden_table_actions_component_spec.rb
Normal file
14
spec/components/admin/hidden_table_actions_component_spec.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Admin::HiddenTableActionsComponent, type: :component do
|
||||
let(:record) { create(:user) }
|
||||
let(:component) { Admin::HiddenTableActionsComponent.new(record) }
|
||||
|
||||
it "renders links to restore and confirm hide" do
|
||||
render_inline component
|
||||
|
||||
expect(page).to have_css "a", count: 2
|
||||
expect(page).to have_css "a[href*='restore'][data-method='put']", text: "Restore"
|
||||
expect(page).to have_css "a[href*='confirm_hide'][data-method='put']", text: "Confirm moderation"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user