openly-rails
openly-rails copied to clipboard
View specs: Add #render helper
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
Note: This issue will become irrelevant once we transition to React and views are no longer handled by Rails.