Class: ViewSpec::ScenarioPreview

Inherits:
Preview
  • Object
show all
Defined in:
lib/view_spec/scenario_preview.rb

Instance Method Summary collapse

Methods inherited from Preview

#params, #render_in, #to_path, #to_url

Constructor Details

#initialize(entry, executable, **options) ⇒ ScenarioPreview

Returns a new instance of ScenarioPreview.



5
6
7
8
# File 'lib/view_spec/scenario_preview.rb', line 5

def initialize(entry, executable, **options)
  @executable = executable
  super(entry, **options)
end

Instance Method Details

#call(view_context = nil) ⇒ Object Also known as: to_s, to_str



10
11
12
13
# File 'lib/view_spec/scenario_preview.rb', line 10

def call(view_context = nil)
  @entry.validate_params(@params)
  @rendered ||= renderer(view_context).render(renderable, layout:)
end

#rawObject



15
16
17
# File 'lib/view_spec/scenario_preview.rb', line 15

def raw
  CGI.unescapeHTML(to_s)
end