unless RUNNING_RAILS require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper") require 'markaby/sinatra' require 'rack/test' require File.expand_path(File.dirname(__FILE__) + "/app") describe "sinatra integration" do include Rack::Test::Methods def app @app ||= Sinatra::Application end it "should render an empty" do get '/empty_action' last_response.should be_ok end it "should render an empty markaby template" do get '/markaby_template' last_response.should be_ok last_response.body.should == "" end it "should render a template with html in it" do get '/simple_html' last_response.should be_ok last_response.body.should == "" end it "should be able to pass variables" do get '/variables' last_response.should be_ok last_response.body.should == '

Scott Taylor

' end it "should be able to pass variables through locals" do get '/variables_with_locals' last_response.should be_ok last_response.body.should == '

Scott Taylor

' end it "should have scope to instance variables" do get '/scope_instance_variables' last_response.should be_ok last_response.body.should == '

Scott Taylor

' end it "should be able to use named templates" do get "/named_template" last_response.should be_ok last_response.body.should == '
Hello World!
' end it "should be able to use a layout with :layout" do get '/layout' last_response.should be_ok last_response.body.should == '
Hello World!
' end it "should be able to access helpers in a template" do get '/helpers' last_response.should be_ok last_response.body.should == "
  • bacon
  • " end end end