Sha256: 5d92468daebede3f56b3a841e3ff58b123b8cfaa1aeedac5e990acd14475438f

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

require 'rubygems'
require 'bundler'

Bundler.setup

require 'test/unit'
require 'mocha'

# Configure Rails
ENV["RAILS_ENV"] = "test"

require 'active_support'
require 'action_controller'
require 'rails/railtie'

class ApplicationController < ActionController::Base
  respond_to :html, :xml
end

$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
require 'responders'

I18n.load_path << File.join(File.dirname(__FILE__), 'locales', 'en.yml')
I18n.reload!

ActionController::Base.view_paths = File.join(File.dirname(__FILE__), 'views')

Responders::Routes = ActionDispatch::Routing::RouteSet.new
Responders::Routes.draw do |map|
  map.connect 'admin/:action', :controller => "admin/addresses"
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action'
end

class ActiveSupport::TestCase
  setup do
    @routes = Responders::Routes
  end
end

class Model < Struct.new(:updated_at)
  attr_writer :persisted

  def persisted?
    defined?(@persisted) ? @persisted : true
  end

  def to_xml(*args)
    "<xml />"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
responders-0.6.1 test/test_helper.rb