From 03bceee2f48612e1fd24659b31fa594e74785ad2 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Fri, 17 Jul 2009 20:20:09 +0000 Subject: [PATCH] Creating stable branch --- test/fixtures/feed_items.yml | 11 +++++++ test/functional/feed_controller_test.rb | 8 ++++++ test/performance/browsing_test.rb | 9 ++++++ test/test_helper.rb | 38 +++++++++++++++++++++++++ test/unit/feed_item_test.rb | 8 ++++++ test/unit/helpers/feed_helper_test.rb | 4 +++ 6 files changed, 78 insertions(+) create mode 100644 test/fixtures/feed_items.yml create mode 100644 test/functional/feed_controller_test.rb create mode 100644 test/performance/browsing_test.rb create mode 100644 test/test_helper.rb create mode 100644 test/unit/feed_item_test.rb create mode 100644 test/unit/helpers/feed_helper_test.rb diff --git a/test/fixtures/feed_items.yml b/test/fixtures/feed_items.yml new file mode 100644 index 0000000..480ee1f --- /dev/null +++ b/test/fixtures/feed_items.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + +one: + feed_name: MyString + title: MyString + description: MyText + +two: + feed_name: MyString + title: MyString + description: MyText diff --git a/test/functional/feed_controller_test.rb b/test/functional/feed_controller_test.rb new file mode 100644 index 0000000..b63fd91 --- /dev/null +++ b/test/functional/feed_controller_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class FeedControllerTest < ActionController::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb new file mode 100644 index 0000000..4b60558 --- /dev/null +++ b/test/performance/browsing_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' +require 'performance_test_help' + +# Profiling results for each test method are written to tmp/performance. +class BrowsingTest < ActionController::PerformanceTest + def test_homepage + get '/' + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 0000000..b9fe251 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,38 @@ +ENV["RAILS_ENV"] = "test" +require File.expand_path(File.dirname(__FILE__) + "/../config/environment") +require 'test_help' + +class ActiveSupport::TestCase + # Transactional fixtures accelerate your tests by wrapping each test method + # in a transaction that's rolled back on completion. This ensures that the + # test database remains unchanged so your fixtures don't have to be reloaded + # between every test method. Fewer database queries means faster tests. + # + # Read Mike Clark's excellent walkthrough at + # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting + # + # Every Active Record database supports transactions except MyISAM tables + # in MySQL. Turn off transactional fixtures in this case; however, if you + # don't care one way or the other, switching from MyISAM to InnoDB tables + # is recommended. + # + # The only drawback to using transactional fixtures is when you actually + # need to test transactions. Since your test is bracketed by a transaction, + # any transactions started in your code will be automatically rolled back. + self.use_transactional_fixtures = true + + # Instantiated fixtures are slow, but give you @david where otherwise you + # would need people(:david). If you don't want to migrate your existing + # test cases which use the @david style and don't mind the speed hit (each + # instantiated fixtures translates to a database query per test method), + # then set this back to true. + self.use_instantiated_fixtures = false + + # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. + # + # Note: You'll currently still have to declare fixtures explicitly in integration tests + # -- they do not yet inherit this setting + fixtures :all + + # Add more helper methods to be used by all tests here... +end diff --git a/test/unit/feed_item_test.rb b/test/unit/feed_item_test.rb new file mode 100644 index 0000000..2078dc3 --- /dev/null +++ b/test/unit/feed_item_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class FeedItemTest < ActiveSupport::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/test/unit/helpers/feed_helper_test.rb b/test/unit/helpers/feed_helper_test.rb new file mode 100644 index 0000000..db262f4 --- /dev/null +++ b/test/unit/helpers/feed_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class FeedHelperTest < ActionView::TestCase +end -- 2.34.1