This project is archived and is in readonly mode.
ActiveRecord tests with the same name
Reported by Paul Campbell | June 7th, 2009 @ 09:59 AM | in 2.x
Hey,
I was mucking about in activerecord/test/cases/finder_test.rb ... about to write a new test, but I came across a bunch of tests with the same name / similar functionality.
For example, lines 158 - 185 have a bunch of finder tests beginning with "test_find_all_with_limit" but this same test is repeated on line 945 and the same functionality tested twice.
It's trivial, but should these repeated tests be removed? I've created the tiny patch here.
Paul
Comments and changes to this ticket
-
CancelProfileIsBroken August 7th, 2009 @ 01:54 PM
- Tag changed from 2-3-stable, patch to 2-3-stable, bugmash, patch
-
Josh Sharpe August 8th, 2009 @ 02:15 AM
Verified that there are duplicate tests going on here -- but I would take this patch a but further:
-
Josh Sharpe August 8th, 2009 @ 02:20 AM
--test_find_all_with_limit Was previously testing :order clause when it shouldn't be
--test_find_all_with_prepared_limit_and_offset Having specifically 3 Entrant fixtures is a requirement for this test, in the event someone adds a fourth down the road, this failing test will be a bit more obvious.
--test_find_all_with_limit_and_offset_and_multiple_order_clauses I prefer the test that I kept here since it explicitly uses the IDs of the fixtures in the expected order.
-
Repository August 8th, 2009 @ 03:57 AM
- State changed from new to committed
(from [9aaeb18781f329bf04c3174898bb8f32581a515e]) Tidy up the AR tests, removing duplicates and making tests clearer / more focussed.
Signed-off-by: Michael Koziarski michael@koziarski.com
[#2774 state:committed] http://github.com/rails/rails/commit/9aaeb18781f329bf04c3174898bb8f...
-
Repository August 8th, 2009 @ 03:57 AM
(from [54e7f5ba435b7573c68c7acd65c9d2537427de7e]) Tidy up the AR tests, removing duplicates and making tests clearer / more focussed.
Signed-off-by: Michael Koziarski michael@koziarski.com
[#2774 state:committed] http://github.com/rails/rails/commit/54e7f5ba435b7573c68c7acd65c9d2...
-
Michael Koziarski August 8th, 2009 @ 04:00 AM
- Tag changed from 2-3-stable, bugmash, patch to 2-3-stable, patch
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 2774 ActiveRecord tests with the same name [#2774 state:committed] http://github.com/rails/rails/co...
- 2774 ActiveRecord tests with the same name [#2774 state:committed] http://github.com/rails/rails/co...