File: abstract_unit.rb

package info (click to toggle)
ruby-actionpack-action-caching 1.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 168 kB
  • ctags: 95
  • sloc: ruby: 564; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 714 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'minitest/autorun'
require 'action_controller'
require 'active_record'
require 'action_controller/action_caching'

FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures')

SharedTestRoutes = ActionDispatch::Routing::RouteSet.new

module ActionController
  class Base
    include SharedTestRoutes.url_helpers

    self.view_paths = FIXTURE_LOAD_PATH
  end

  class TestCase
    def setup
      @routes = SharedTestRoutes

      @routes.draw do
        get ':controller(/:action)'
      end
    end
  end
end

module RackTestUtils
  def body_to_string(body)
    if body.respond_to?(:each)
      str = ''
      body.each {|s| str << s }
      str
    else
      body
    end
  end
  extend self
end