Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

Add assert_query method to AR test_helper

#325

Added a assert_query method that supplements assert_queries so that you can make assertions about the actual contents of queries in addition to the count.

This is essential functionality for me to write a test showing how #109 [patch] Ensure necessary included tables are joined in construct_finder_sql_f... clobbered my original patch, and I think could be more widely useful in the future.

Reported by Gabe da Silveira · June 3rd, 2008 @ 10:01 PM

State: resolved
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • State changed from new to incomplete
    • Assigned user set to Pratik

    Two issues :

    • I think the name is a bit confusing with assert_queries. Could you please rename it to assert_executes or anything better you can think of ( and doesnt sound like assert_queries )
    • It'd be nice to use this feature in any of the existing tests to a) Improve existing tests and b) test this feature itself.

    Thanks.

    June 4th, 2008 @ 10:27 PM

  2. Tarmo Tänav
    Tarmo Tänav
    • Tag set to activerecord, enhancement, patch

    Renamed assert_query to assert_sql, test in the patch for #602 Quoting issues in AR's association preload

    July 14th, 2008 @ 08:29 PM

  3. Repository
    Repository
    • State changed from incomplete to resolved

    (from [cd9b24286a90111a08002e0da753198c5fb2432a]) Add assert_sql helper method to check for specific SQL output in Active Record test suite. [#325 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 14th, 2008 @ 11:29 PM

  4. Repository
    Repository

    (from [97fa8547b2d3cf069a45fff76ecf5f0ce598fad1]) Add assert_sql helper method to check for specific SQL output in Active Record test suite. [#325 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 15th, 2008 @ 11:56 PM