Skip to content

Instantly share code, notes, and snippets.

@seebq
Created August 28, 2008 17:28
Show Gist options
  • Save seebq/7778 to your computer and use it in GitHub Desktop.
Save seebq/7778 to your computer and use it in GitHub Desktop.
require 'test_helper'
class FishTest < ActiveSupport::TestCase
# Replace this with your real tests.
def test_fish_belongs_to_pond
pond = Pond.create!
fish = pond.fishes.create!()
assert pond.fishes.member?(fish) # works
fish = Fish.create(:pond => pond)
assert pond.fishes.reload.member?(fish) # Does not work
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment