We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e23fb3 commit f819db1Copy full SHA for f819db1
spec/views/components/code_block/app_file_run_spec.rb
@@ -0,0 +1,23 @@
1
+require "rails_helper"
2
+
3
+RSpec.describe CodeBlock::AppFileRun, type: :view do
4
+ def render_page(*, **)
5
+ Capybara.string(render(*, **))
6
+ end
7
8
+ before do
9
+ allow(view).to receive(:headers).and_return({"Content-Type" => "text/html"})
10
11
12
+ it "renders contents of file" do
13
+ page = render_page(CodeBlock::AppFileRun.new("spec/fixtures/code_block/app_file/example.rb"))
14
+ expect(page).to have_content(<<~RUBY.strip)
15
+ class FixturesCodeBlockAppFileExample
16
+ def add(m, n)
17
+ m + n
18
19
20
+ RUBY
21
+ expect(page).to have_content("spec/fixtures/code_block/app_file/example.rb")
22
23
+end
0 commit comments