Sha256: ef74bac5949b27c833326eefe58af07391d241121f970c7ab8815f0dbd0df131

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

require 'test_helper'

class PersonTest < ActiveSupport::TestCase
  background do
    some_test_helper_returning_one
    @hase = Person.create(:name => "bunny")
  end

  context "with thies" do
    background do
      some_test_helper_returning_one
      @thies = Person.create(:name => "thies")
    end
    
    should "be cool" do
      assert @hase
      assert @thies
      assert_nil @manuel
      assert_nil @norman
      assert_equal 2, Person.count
    end

    context "with manuel" do
      background do
        @manuel = Person.create(:name => "manuel")
      end
    
      should "be cool" do
        assert @hase
        assert @thies
        assert @manuel
        assert_nil @norman
        assert_equal 3, Person.count
      end
      
      context "with norman" do
        background do
          @norman = Person.create(:name => "norman")
        end
      
        should "be cool" do
          assert @hase
          assert @thies
          assert @manuel
          assert @norman
          assert_equal 4, Person.count
        end
      end
    end

    should "nother truth" do
      assert @hase
      assert @thies
      assert_nil @manuel
      assert_nil @norman
      assert_equal 2, Person.count
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fixture_background-0.9.4 test/rails3/test/unit/person_test.rb
fixture_background-0.9.3 test/rails3/test/unit/person_test.rb
fixture_background-0.9.2 test/rails3/test/unit/person_test.rb