File: verify_view_path_stub_spec.rb

package info (click to toggle)
ruby-rspec-rails 8.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,804 kB
  • sloc: ruby: 10,881; sh: 198; makefile: 6
file content (17 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'rails_helper'

RSpec.describe "verify view path doesn't leak stubs between examples", type: :view, order: :defined do
  subject(:html) do
    render partial: "example"
    rendered
  end

  it "renders the stub template" do
    stub_template("_example.html.erb" => "STUB_HTML")
    expect(html).to include("STUB_HTML")
  end

  it "renders the file template" do
    expect(html).to include("TEMPLATE_HTML")
  end
end