Sha256: 27582648c61de2c12c8f1c1144fce37e61ad5bcd4d6e77f99383d6fbdb73ad19

Contents?: true

Size: 866 Bytes

Versions: 2

Compression:

Stored size: 866 Bytes

Contents

__DIR__ = File.dirname(__FILE__)
require File.join(__DIR__, "..", "..", "spec_helper")

require File.join(__DIR__, "controllers", "filters")
require File.join(__DIR__, "controllers", "render")
require File.join(__DIR__, "controllers", "partial")
require File.join(__DIR__, "controllers", "display")
require File.join(__DIR__, "controllers", "helpers")

Merb.start :environment => 'test'

module Merb::Test::Behaviors
  include Merb::Test::RequestHelper
  
  def dispatch_should_make_body(klass, body, action = :index, opts = {})
    controller = Merb::Test::Fixtures::Abstract.const_get(klass).new
    if opts.key?(:presets)
      opts[:presets].each { |attr, value| controller.send(attr, value)}
    end
    controller._dispatch(action.to_s)
    controller.body.should == body
  end
end

Spec::Runner.configure do |config|
  config.include Merb::Test::Behaviors
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
merb-core-0.9.2 spec/public/abstract_controller/spec_helper.rb
merb-core-0.9.3 spec/public/abstract_controller/spec_helper.rb