Changeset 8022
- Timestamp:
- 10/26/07 02:21:21 (7 months ago)
- Files:
-
- trunk/actionmailer/CHANGELOG (modified) (1 diff)
- trunk/actionmailer/lib/action_mailer/test_case.rb (added)
- trunk/actionmailer/test/abstract_unit.rb (modified) (1 diff)
- trunk/actionmailer/test/test_helper_test.rb (modified) (1 diff)
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/test_case.rb (added)
- trunk/actionpack/test/controller/test_test.rb (modified) (2 diffs)
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/test_case.rb (added)
- trunk/activesupport/lib/active_support/testing (added)
- trunk/activesupport/lib/active_support/testing.rb (added)
- trunk/activesupport/lib/active_support/testing/default.rb (added)
- trunk/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb (modified) (1 diff)
- trunk/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb (modified) (2 diffs)
- trunk/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb (modified) (1 diff)
- trunk/railties/lib/test_help.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionmailer/CHANGELOG
r7921 r8022 1 1 *SVN* 2 3 * Introduce a new base test class for testing Mailers. ActionMailer::TestCase [Koz] 2 4 3 5 * Fix silent failure of rxml templates. #9879 [jstewart] trunk/actionmailer/test/abstract_unit.rb
r7547 r8022 3 3 $:.unshift "#{File.dirname(__FILE__)}/../lib" 4 4 require 'action_mailer' 5 require 'action_mailer/test_case' 5 6 6 7 # Show backtraces for deprecated behavior for quicker cleanup. trunk/actionmailer/test/test_helper_test.rb
r7070 r8022 9 9 end 10 10 11 class TestHelperTest < Test::Unit::TestCase 12 def setup 13 ActionMailer::Base.delivery_method = :test 14 ActionMailer::Base.perform_deliveries = true 15 ActionMailer::Base.deliveries = [] 11 class TestHelperMailerTest < ActionMailer::TestCase 12 13 def test_setup_sets_right_action_mailer_options 14 assert_equal :test, ActionMailer::Base.delivery_method 15 assert ActionMailer::Base.perform_deliveries 16 assert_equal [], ActionMailer::Base.deliveries 17 end 18 19 def test_setup_creates_the_expected_mailer 20 assert @expected.is_a?(TMail::Mail) 21 assert_equal "1.0", @expected.mime_version 22 assert_equal "text/plain", @expected.content_type 23 end 24 25 def test_mailer_class_is_correctly_inferred 26 assert_equal TestHelperMailer, self.class.mailer_class 27 end 28 29 def test_determine_default_mailer_raises_correct_error 30 assert_raises(ActionMailer::NonInferrableMailerError) do 31 self.class.determine_default_mailer("NotAMailerTest") 32 end 16 33 end 17 34 35 def test_charset_is_utf_8 36 assert_equal "utf-8", charset 37 end 38 39 def test_encode 40 assert_equal "=?utf-8?Q?=0aasdf=0a?=", encode("\nasdf\n") 41 end 42 18 43 def test_assert_emails 19 44 assert_nothing_raised do trunk/actionpack/CHANGELOG
r8019 r8022 1 1 *SVN* 2 3 * Introduce a new test case class for functional tests. ActionController::TestCase. [Koz] 2 4 3 5 * Fix incorrect path in helper rdoc. Closes #9926 [viktor tron] trunk/actionpack/test/controller/test_test.rb
r7992 r8022 1 1 require "#{File.dirname(__FILE__)}/../abstract_unit" 2 2 require "#{File.dirname(__FILE__)}/fake_controllers" 3 require "action_controller/test_case" 3 4 4 5 class TestTest < Test::Unit::TestCase … … 581 582 end 582 583 end 584 585 class InferringClassNameTest < Test::Unit::TestCase 586 def test_determine_controller_class 587 assert_equal ContentController, determine_class("ContentControllerTest") 588 end 589 590 def test_determine_controller_class_with_nonsense_name 591 assert_raises ActionController::NonInferrableControllerError do 592 determine_class("HelloGoodBye") 593 end 594 end 595 596 def test_determine_controller_class_with_sensible_name_where_no_controller_exists 597 assert_raises ActionController::NonInferrableControllerError do 598 determine_class("NoControllerWithThisNameTest") 599 end 600 end 601 602 private 603 def determine_class(name) 604 ActionController::TestCase.determine_default_controller_class(name) 605 end 606 end 607 608 class CrazyNameTest < ActionController::TestCase 609 tests ContentController 610 def test_controller_class_can_be_set_manually_not_just_inferred 611 assert_equal ContentController, self.class.controller_class 612 end 613 end 614 trunk/activesupport/CHANGELOG
r8010 r8022 1 1 *SVN* 2 3 * Introduce a base class for all test cases used by rails applications. ActiveSupport::TestCase [Koz] 4 5 The intention is to use this to reduce the amount of monkeypatching / overriding that 6 is done to test/unit's classes. 2 7 3 8 * Document Enumerable and Hash #to_json. #9970 [Chu Yeow] trunk/activesupport/lib/active_support.rb
r7828 r8022 46 46 require 'active_support/multibyte' 47 47 48 require 'active_support/testing' 49 trunk/railties/lib/rails_generator/generators/components/controller/templates/functional_test.rb
r663 r8022 1 1 require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' 2 require '<%= file_path %>_controller'3 2 4 # Re-raise errors caught by the controller. 5 class <%= class_name %>Controller; def rescue_action(e) raise e end; end 6 7 class <%= class_name %>ControllerTest < Test::Unit::TestCase 8 def setup 9 @controller = <%= class_name %>Controller.new 10 @request = ActionController::TestRequest.new 11 @response = ActionController::TestResponse.new 12 end 3 class <%= class_name %>ControllerTest < ActionController::TestCase 4 tests <%= class_name %>Controller 13 5 14 6 # Replace this with your real tests. trunk/railties/lib/rails_generator/generators/components/mailer/templates/unit_test.rb
r5329 r8022 1 1 require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' 2 2 3 class <%= class_name %>Test < Test::Unit::TestCase 4 FIXTURES_PATH = File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../fixtures' 5 CHARSET = "utf-8" 6 7 include ActionMailer::Quoting 8 9 def setup 10 ActionMailer::Base.delivery_method = :test 11 ActionMailer::Base.perform_deliveries = true 12 ActionMailer::Base.deliveries = [] 13 14 @expected = TMail::Mail.new 15 @expected.set_content_type "text", "plain", { "charset" => CHARSET } 16 @expected.mime_version = '1.0' 17 end 18 3 class <%= class_name %>Test < ActionMailer::TestCase 4 tests <%= class_name %> 19 5 <% for action in actions -%> 20 6 def test_<%= action %> … … 27 13 28 14 <% end -%> 29 private 30 def read_fixture(action) 31 IO.readlines("#{FIXTURES_PATH}/<%= file_path %>/#{action}") 32 end 33 34 def encode(subject) 35 quoted_printable(subject, CHARSET) 36 end 15 <% if actions.blank? -%> 16 # replace this with your real tests 17 def test_truth 18 assert true 19 end 20 <% end -%> 37 21 end trunk/railties/lib/rails_generator/generators/components/model/templates/unit_test.rb
r7705 r8022 1 1 require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../test_helper' 2 2 3 class <%= class_name %>Test < Test::Unit::TestCase3 class <%= class_name %>Test < ActiveSupport::TestCase 4 4 # Replace this with your real tests. 5 5 def test_truth trunk/railties/lib/test_help.rb
r7395 r8022 6 6 7 7 require 'test/unit' 8 require 'active_support/test_case' 8 9 require 'active_record/fixtures' 10 require 'active_record/test_case' 11 require 'action_controller/test_case' 9 12 require 'action_controller/test_process' 10 13 require 'action_controller/integration' 14 require 'action_mailer/test_case' 11 15 12 16 Test::Unit::TestCase.fixture_path = RAILS_ROOT + "/test/fixtures/"