aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/mixin_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-16 13:42:21 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-16 13:42:21 +0000
commit87297f1c4be22c10de138709ba2d6c3ace4b0117 (patch)
tree7f2ec2e8aea4a907834bae84e9cfb51c8588fb67 /activerecord/test/mixin_test.rb
parent4d6bfc7a3615c68544ce10373e699eec1dfea669 (diff)
downloadrails-87297f1c4be22c10de138709ba2d6c3ace4b0117.tar.gz
rails-87297f1c4be22c10de138709ba2d6c3ace4b0117.tar.bz2
rails-87297f1c4be22c10de138709ba2d6c3ace4b0117.zip
Added assumption that a Symbol-based scope should end in _id unless it does so already and that you can pass vanilla string-based scopes as a parameter
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@183 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/mixin_test.rb')
-rw-r--r--activerecord/test/mixin_test.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/activerecord/test/mixin_test.rb b/activerecord/test/mixin_test.rb
index 107d6d2f0a..58e7ff1807 100644
--- a/activerecord/test/mixin_test.rb
+++ b/activerecord/test/mixin_test.rb
@@ -28,7 +28,7 @@ class ListTest < Test::Unit::TestCase
end
- def test_insert
+ def test_insert
new = ListMixin.create("parent_id"=>5)
assert_equal 1, new.pos
assert new.first?
@@ -48,8 +48,7 @@ class ListTest < Test::Unit::TestCase
assert_equal 1, new.pos
assert new.first?
assert new.last?
- end
-
+ end
def test_delete_middle
first = ListMixin.create("parent_id"=>5)
@@ -68,6 +67,12 @@ class ListTest < Test::Unit::TestCase
end
+ def test_with_string_based_scope
+ new = ListWithStringScopeMixin.create("parent_id"=>5)
+ assert_equal 1, new.pos
+ assert new.first?
+ assert new.last?
+ end
end
class TreeTest < Test::Unit::TestCase