提交 562a12df 编写于 作者: C Carlos Antonio da Silva

Rename test class and fix tests to keep consistency

Based on 50d23bc2.
上级 bb33e888
......@@ -2,7 +2,7 @@
require 'controller/fake_controllers'
require 'active_support/ordered_hash'
class TestTest < ActionController::TestCase
class TestCaseTest < ActionController::TestCase
class TestController < ActionController::Base
def no_op
render :text => 'dummy'
......@@ -171,7 +171,7 @@ def test_body_stream
def test_document_body_and_params_with_post
post :test_params, :id => 1
assert_equal("{\"id\"=>\"1\", \"controller\"=>\"test_test/test\", \"action\"=>\"test_params\"}", @response.body)
assert_equal("{\"id\"=>\"1\", \"controller\"=>\"test_case_test/test\", \"action\"=>\"test_params\"}", @response.body)
end
def test_document_body_with_post
......@@ -244,18 +244,18 @@ def test_response_and_request_have_nice_accessors
def test_process_with_request_uri_with_no_params
process :test_uri
assert_equal "/test_test/test/test_uri", @response.body
assert_equal "/test_case_test/test/test_uri", @response.body
end
def test_process_with_request_uri_with_params
process :test_uri, "GET", :id => 7
assert_equal "/test_test/test/test_uri/7", @response.body
assert_equal "/test_case_test/test/test_uri/7", @response.body
end
def test_process_with_old_api
assert_deprecated do
process :test_uri, :id => 7
assert_equal "/test_test/test/test_uri/7", @response.body
assert_equal "/test_case_test/test/test_uri/7", @response.body
end
end
......@@ -539,7 +539,7 @@ def test_params_passing
get :test_params, :page => {:name => "Page name", :month => '4', :year => '2004', :day => '6'}
parsed_params = eval(@response.body)
assert_equal(
{'controller' => 'test_test/test', 'action' => 'test_params',
{'controller' => 'test_case_test/test', 'action' => 'test_params',
'page' => {'name' => "Page name", 'month' => '4', 'year' => '2004', 'day' => '6'}},
parsed_params
)
......@@ -549,7 +549,7 @@ def test_params_passing_with_fixnums
get :test_params, :page => {:name => "Page name", :month => 4, :year => 2004, :day => 6}
parsed_params = eval(@response.body)
assert_equal(
{'controller' => 'test_test/test', 'action' => 'test_params',
{'controller' => 'test_case_test/test', 'action' => 'test_params',
'page' => {'name' => "Page name", 'month' => '4', 'year' => '2004', 'day' => '6'}},
parsed_params
)
......@@ -561,7 +561,7 @@ def test_params_passing_with_frozen_values
end
parsed_params = eval(@response.body)
assert_equal(
{'controller' => 'test_test/test', 'action' => 'test_params',
{'controller' => 'test_case_test/test', 'action' => 'test_params',
'frozen' => 'icy', 'frozens' => ['icy']},
parsed_params
)
......@@ -581,7 +581,7 @@ def test_id_converted_to_string
def test_array_path_parameter_handled_properly
with_routing do |set|
set.draw do
match 'file/*path', :to => 'test_test/test#test_params'
match 'file/*path', :to => 'test_case_test/test#test_params'
match ':controller/:action'
end
......@@ -716,7 +716,7 @@ def test_test_uploaded_file
end
def test_fixture_path_is_accessed_from_self_instead_of_active_support_test_case
TestTest.stubs(:fixture_path).returns(FILES_DIR)
TestCaseTest.stubs(:fixture_path).returns(FILES_DIR)
uploaded_file = fixture_file_upload('/mona_lisa.jpg', 'image/png')
assert_equal File.open("#{FILES_DIR}/mona_lisa.jpg", READ_PLAIN).read, uploaded_file.read
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册