spec/integration/template_spec.rb in goliath-0.9.4 vs spec/integration/template_spec.rb in goliath-1.0.0.beta.1
- old
+ new
@@ -1,29 +1,34 @@
require 'spec_helper'
require File.join(File.dirname(__FILE__), '../../', 'examples/template')
-
describe Template do
-
def config_file
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'examples', 'config', 'template.rb'))
end
let(:api_options) { { :config => config_file } }
it 'renders haml template with default haml layout' do
-
with_api(Template, api_options) do
- get_request do |c|
+ get_request(:path => '/root') do |c|
c.response.should =~ %r{<li><a href="/joke">Tell me a joke</a></li>}
end
end
end
+ it 'renders haml template from string with default haml layout' do
+ with_api(Template, api_options) do
+ get_request(:path => '/haml_str') do |c|
+ c.response.should =~ %r{<h1>Header</h1>}
+ end
+ end
+ end
+
it 'renders a markdown template with default haml layout' do
with_api(Template, api_options) do
get_request(:path => '/joke') do |c|
- c.response.should =~ %r{<code>"Arr, I dunno matey -- but it's drivin' me nuts!"\s*</code>}m
+ c.response.should =~ %r{<code>Arr, I dunno matey -- but it is driving me nuts!\s*</code>}m
end
end
end
it 'lets me specify an alternate layout engine' do