Sha256: e4a5605f053c64b27e064ed5f74a24b3fa29843c6ef4860b8f0298b127eed1c6

Contents?: true

Size: 866 Bytes

Versions: 1

Compression:

Stored size: 866 Bytes

Contents

module Roar
  module Rails
    module TestCase
      def get(action, *args)
        process(action, "GET", nil, *args)
      end
      
      def post(action, *args)
        process(action, "POST", *args)
      end
      
      def put(action, *args)
        process(action, "PUT", *args)
      end
      
      def delete(action, *args)
        process(action, "DELETE", *args)
      end
      
      def process(action, http_method, document="", params={})
        request.env['RAW_POST_DATA'] = document
        super(action, params, nil, nil, http_method)
      end
      
      module Assertions
        require 'test_xml/test_unit'
        def assert_body(body, options={})
          return assert_xml_equal body, response.body if options[:xml]
          assert_equal body, response.body
        end
      end
      
      include Assertions
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roar-rails-0.0.1 lib/roar/rails/test_case.rb