Sha256: 857eaaff98f81a208eb51b9085058af92c2f7649b62d24fc9a327a007a7a805b
Contents?: true
Size: 709 Bytes
Versions: 14
Compression:
Stored size: 709 Bytes
Contents
require File.dirname(__FILE__) + '/../test_helper.rb' module ConditionsTests class ProtectionTest < ActiveSupport::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 end
Version data entries
14 entries across 14 versions & 2 rubygems