Skip to content

Instantly share code, notes, and snippets.

View matsales28's full-sized avatar
🎯
Focusing

Matheus Sales matsales28

🎯
Focusing
View GitHub Profile
@matsales28
matsales28 / have_rendered_component_matcher.rb
Created November 16, 2022 15:19
Create matcher for asserting components of ViewComponents have been rendered with arguments or not
# This gist was used to create have_rendered_page_component matcher, because our intention was to
# assure that a specific page_component was being rendered.
# This is overriding the instrumentation of ViewComponent
# to include the parameters that a component might receive when rendering.
# frozen_string_literal: true
require "active_support/notifications"
require "active_support/concern"