aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/associations_test.rb')
-rwxr-xr-xactiverecord/test/associations_test.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb
index 2d7ebc2b42..70f0eac7ee 100755
--- a/activerecord/test/associations_test.rb
+++ b/activerecord/test/associations_test.rb
@@ -1099,6 +1099,22 @@ class HasAndBelongsToManyAssociationsTest < Test::Unit::TestCase
assert_equal 3, project.access_level.to_i
end
+ def test_hatbm_attribute_access_and_respond_to
+ project = developers(:jamis).projects[0]
+ assert project.has_attribute?("name")
+ assert project.has_attribute?("joined_on")
+ assert project.has_attribute?("access_level")
+ assert project.respond_to?("name")
+ assert project.respond_to?("name=")
+ assert project.respond_to?("name?")
+ assert project.respond_to?("joined_on")
+ assert project.respond_to?("joined_on=")
+ assert project.respond_to?("joined_on?")
+ assert project.respond_to?("access_level")
+ assert project.respond_to?("access_level=")
+ assert project.respond_to?("access_level?")
+ end
+
def test_habtm_adding_before_save
no_of_devels = Developer.count
no_of_projects = Project.count