On 22 June 2012 15:07, Gurdipe Dosanjh
<rhomobileapps-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> What is the best way to unit test hard coded sql in a rails application.
You don''t test SQL, you test methods. Whether the method gets
it''s
results through ActiveRecord, raw SQL, or fairies rummaging around the
hard drive, it''s irrelevant to the tests. They should just be testing
that the expected values are returned by the method.
So the answer to your question may be "move the SQL to be wrapped by
methods, and test those", but without seeing some source code it would
be hard to say.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.