aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_interface_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-12-02 06:03:43 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-12-02 06:03:43 +0000
commit57b7532b910f9258cad4111db79349d2d63be6d4 (patch)
tree32da547566c74dba559ae04ed073d1b3d9deb10b /activerecord/test/associations_interface_test.rb
parent96c29ab890edaa54840f2cb0c9760b82ef875958 (diff)
downloadrails-57b7532b910f9258cad4111db79349d2d63be6d4.tar.gz
rails-57b7532b910f9258cad4111db79349d2d63be6d4.tar.bz2
rails-57b7532b910f9258cad4111db79349d2d63be6d4.zip
Work-in progress for providing better join model support and polymorphic associations
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3209 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/associations_interface_test.rb')
-rw-r--r--activerecord/test/associations_interface_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/test/associations_interface_test.rb b/activerecord/test/associations_interface_test.rb
new file mode 100644
index 0000000000..5f9447294a
--- /dev/null
+++ b/activerecord/test/associations_interface_test.rb
@@ -0,0 +1,17 @@
+require 'abstract_unit'
+require 'fixtures/tag'
+require 'fixtures/tagging'
+require 'fixtures/post'
+require 'fixtures/comment'
+
+class AssociationsInterfaceTest < Test::Unit::TestCase
+ fixtures :posts, :comments, :tags, :taggings
+
+ def test_post_having_a_single_tag_through_has_many
+ assert_equal taggings(:welcome_general), posts(:welcome).taggings.first
+ end
+
+ def test_post_having_a_single_tag_through_belongs_to
+ assert_equal posts(:welcome), posts(:welcome).taggings.first.taggable
+ end
+end