module ViewComponent::TestHelpers

def with_variant(variant)

Parameters:
  • variant (Symbol) -- The variant to be set for the provided block.
def with_variant(variant)
  old_variants = vc_test_controller.view_context.lookup_context.variants
  vc_test_controller.view_context.lookup_context.variants = variant
  yield
ensure
  vc_test_controller.view_context.lookup_context.variants = old_variants
end