aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_interface_test.rb
diff options
context:
space:
mode:
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