Hi,

In cases where I have model methods that are generating data based on
non-trivial SQL queries to a database (e.g. to pull together data
required to plot an appropriate graph), does this really require a
traditional fixture (i.e. pre-canned test data) as opposed to use of
mocks?

That is, the bulk of the method is really the SQL that is pull back
(with multiple joins / selects etc) the data required.  Testing to
some extent should be focused around testing the SQL is producing what
it should.   How would one use rspec / mocha to solve this?  i.e. in a
normal testing sense you may need 5 to 10 rows before you can feel
comfortable the SQL code is doing what it should..

Tks
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to