openly-rails icon indicating copy to clipboard operation
openly-rails copied to clipboard

View specs: Add #render helper

Open FinnWoelm opened this issue 7 years ago • 1 comments

Overwrite #render method to include layout by default.

Merge:

  # Overwrite the render method to include locals
  def render
    allow(view).to receive(:parent_layout)
    file_name = self.class.top_level_description
    super(
      template: file_name,
      layout: "layouts/#{file_name.rpartition('/').first}"
    )
  end

and:

# Overwrite the render method to include locals
def render
  super(template: self.class.top_level_description, locals: locals)
end

FinnWoelm avatar Dec 06 '18 12:12 FinnWoelm

Note: This issue will become irrelevant once we transition to React and views are no longer handled by Rails.

FinnWoelm avatar Jan 17 '19 08:01 FinnWoelm