Sha256: fa0bc9f56bf7c2aeb6c510e9c0b41137a5638ade520476c4011f77c1a5445ef8
Contents?: true
Size: 963 Bytes
Versions: 23
Compression:
Stored size: 963 Bytes
Contents
require_relative '../spec_helper' require 'angelo/tilt/erb' describe Angelo::Base do describe Angelo::Tilt::ERB do define_app do include Angelo::Tilt::ERB @root = TEST_APP_ROOT def set_vars @title = 'test' @foo = params[:foo] end get '/' do set_vars erb :index, locals: {bar: 'bat'} end get '/no_layout' do set_vars erb :index, layout: false, locals: {bar: 'bat'} end end it 'renders templates with layout' do get '/', foo: 'asdf' expected = <<HTML <!doctype html> <html> <head> <title>test</title> </head> <body> foo - asdf locals :bar - bat </body> </html> HTML last_response_must_be_html expected end it 'renders templates without layout' do get '/no_layout', foo: 'asdf' expected = <<HTML foo - asdf locals :bar - bat HTML last_response_must_be_html expected end end end
Version data entries
23 entries across 23 versions & 1 rubygems