Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7819: test_controller_test.rb

File test_controller_test.rb, 0.6 kB (added by TaQ, 2 years ago)
Line 
1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'test_controller'
3 require 'open-uri'
4
5 # Re-raise errors caught by the controller.
6 class TestController; def rescue_action(e) raise e end; end
7
8 class TestControllerTest < Test::Unit::TestCase
9   def setup
10     @controller = TestController.new
11     @request    = ActionController::TestRequest.new
12     @response   = ActionController::TestResponse.new
13   end
14
15   # Replace this with your real tests.
16   def test_fragments
17     open("http://localhost:3000/test/test")
18     open("http://127.0.0.1:3000/test/test")
19     assert_equal(1,Dir.glob(RAILS_ROOT+"/tmp/cache/*").size)
20   end
21 end