mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
6abda696b5
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3213 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
21 lines
586 B
Ruby
21 lines
586 B
Ruby
require 'abstract_unit'
|
|
require 'fixtures/tag'
|
|
require 'fixtures/tagging'
|
|
require 'fixtures/post'
|
|
require 'fixtures/comment'
|
|
|
|
class AssociationsJoinModelTest < Test::Unit::TestCase
|
|
fixtures :posts, :comments, :tags, :taggings
|
|
|
|
def test_polymorphic_has_many
|
|
assert_equal taggings(:welcome_general), posts(:welcome).taggings.first
|
|
end
|
|
|
|
def test_polymorphic_belongs_to
|
|
assert_equal posts(:welcome), posts(:welcome).taggings.first.taggable
|
|
end
|
|
|
|
def test_polymorphic_has_many_going_through_join_model
|
|
assert_equal tags(:general), posts(:welcome).tags.first
|
|
end
|
|
end
|