File: preview_component_spec.rb

package info (click to toggle)
ruby-view-component 4.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,832 kB
  • sloc: ruby: 8,385; sh: 166; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
describe PreviewComponent do
  before do
    ViewComponent::Preview.__vc_load_previews
  end

  it "renders the preview" do
    render_preview(:default)

    expect(page).to have_css "h1", text: "Lorem Ipsum"
  end
end

describe "PreviewComponent" do
  before do
    ViewComponent::Preview.__vc_load_previews
  end

  it "raises an error" do
    expect { render_preview(:default) }.to raise_error(/expected a described_class/)
  end
end