brandoncordell said almost 2 years ago on Testing View Components :
I'm running into an issue with view components. I generated a component called `LikeButtonComponent`. The default generated test won't run. Here's the test as it sits:

# frozen_string_literal: true

require 'test_helper'

class LikeButtonComponentTest < ViewComponent::TestCase
  def test_component_renders_something_useful
      %(<span>Hello, components!</span>),
      render_inline( "Hello, components!")).css("span").to_html

This gives a `NameError: uninitialized constant LikeButtonComponentTest::LikeButtonComponent`.

Any ideas? I'm on Rails 6.1.4, Ruby 3.0.1, and view_components 2.37.0.

Login to Comment