Skip to content

Commit

Permalink
Add parentheses to avoid warnings when running AR tests.
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
miloops authored and josevalim committed Jun 8, 2010
1 parent d103c73 commit ab2877c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activerecord/test/cases/adapter_test.rb
Expand Up @@ -145,13 +145,13 @@ def test_foreign_key_violations_are_translated_to_specific_exception

def test_add_limit_offset_should_sanitize_sql_injection_for_limit_without_comas
sql_inject = "1 select * from schema"
assert_no_match /schema/, @connection.add_limit_offset!("", :limit=>sql_inject)
assert_no_match /schema/, @connection.add_limit_offset!("", :limit=>sql_inject, :offset=>7)
assert_no_match(/schema/, @connection.add_limit_offset!("", :limit=>sql_inject))
assert_no_match(/schema/, @connection.add_limit_offset!("", :limit=>sql_inject, :offset=>7))
end

def test_add_limit_offset_should_sanitize_sql_injection_for_limit_with_comas
sql_inject = "1, 7 procedure help()"
assert_no_match /procedure/, @connection.add_limit_offset!("", :limit=>sql_inject)
assert_no_match /procedure/, @connection.add_limit_offset!("", :limit=>sql_inject, :offset=>7)
assert_no_match(/procedure/, @connection.add_limit_offset!("", :limit=>sql_inject))
assert_no_match(/procedure/, @connection.add_limit_offset!("", :limit=>sql_inject, :offset=>7))
end
end

2 comments on commit ab2877c

@ernie
Copy link
Contributor

@ernie ernie commented on ab2877c Jun 8, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"with_comas" == A test for code that becomes a vegetable? :)

@Aupajo
Copy link
Contributor

@Aupajo Aupajo commented on ab2877c Jun 9, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ernie Comments like these make me wish GitHub had an upvote button.

Please sign in to comment.