Sha256: de48edc795ab20d0cc28844908de30d94a34e11e214fda1f39ba5e7345f85220
Contents?: true
Size: 665 Bytes
Versions: 16
Compression:
Stored size: 665 Bytes
Contents
require File.dirname(__FILE__) + '/test_helper.rb' class TestConditionsProtection < Test::Unit::TestCase def test_protection assert_raise(ArgumentError) { Account.new_search(:conditions => "(DELETE FROM users)") } assert_nothing_raised { Account.new_search!(:conditions => "(DELETE FROM users)") } account = Account.first assert_raise(ArgumentError) { account.users.new_search(:conditions => "(DELETE FROM users)") } assert_nothing_raised { account.users.new_search!(:conditions => "(DELETE FROM users)") } search = Account.new_search assert_raise(ArgumentError) { search.conditions = "(DELETE FROM users)" } end end
Version data entries
16 entries across 16 versions & 2 rubygems