Sha256: 0cb39523a4b58a01e08004d52e39687a369e7a5f7a279bb69aff60fc92ea4380

Contents?: true

Size: 630 Bytes

Versions: 1

Compression:

Stored size: 630 Bytes

Contents

require "rubygems"
require "bundler/setup"

require "pry"

require "active_model_serializers"
require "active_support/json"
require "minitest/autorun"

require 'rails'

module TestHelper
  Routes = ActionDispatch::Routing::RouteSet.new
  Routes.draw do
    resource :hypermedia
    get ':controller(/:action(/:id))'
    get ':controller(/:action)'
  end

  ActionController::Base.send :include, Routes.url_helpers
  ActiveModel::Serializer.send :include, Routes.url_helpers
end

ActiveSupport::TestCase.class_eval do
  setup do
    @routes = ::TestHelper::Routes
  end
end

class Object
  undef_method :id if respond_to?(:id)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_model_serializers-0.8.3 test/test_helper.rb