Plugins - All Fixtures

StarAdd to favorites

This plugin provide a replacement for the fixtures method in your tests. It provides a way to specify that every single fixture is loaded for the test with a simple easy command.

Usage could not be simpler:

Installation

  ruby script/plugin install -x http://beautifulpixel.com/svn/plugins/all_fixtures

leave out the "-x" if your project is not under subversion.

Usage

  # test/unit/blog_article.rb
  class BlogArticleTest < Test::Unit::TestCase
    all_fixtures

    def test_user_association
      assert_equal users(:quentin), blog_articles(:launch).user
    end

    def test_comment_association
      assert_equal [comments(:supportive)], blog_articles(:launch).comments
    end
  end

Or to automatically have every single test use every single fixture without having to call all_fixtures in each test file do the following.

  # test/test_helper.rb
  class Test::Unit::TestCase
    all_fixtures
  end

Alex Wayne

http://beautifulpixel.com/all_fixtures/index.html

http://beautifulpixel.com/svn/plugins/all_fixtures/

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Testing

Tags

Comments

Add a comment
Marc-André 24 Jul 2008

Isn't this done by default as of (at least) rails 2.1.0?

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?