mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
9340f89849
Thanks to Ben Murphy for reporting this CVE-2012-2661
19 lines
440 B
Ruby
19 lines
440 B
Ruby
require "cases/helper"
|
|
require 'models/post'
|
|
|
|
module ActiveRecord
|
|
class WhereTest < ActiveRecord::TestCase
|
|
fixtures :posts
|
|
|
|
def test_where_error
|
|
assert_raises(ActiveRecord::StatementInvalid) do
|
|
Post.where(:id => { 'posts.author_id' => 10 }).first
|
|
end
|
|
end
|
|
|
|
def test_where_with_table_name
|
|
post = Post.first
|
|
assert_equal post, Post.where(:posts => { 'id' => post.id }).first
|
|
end
|
|
end
|
|
end
|