Ruby on Rails Sunday, January 4, 2015

I'm using Rails 4 and the testing framework with which it ships.

I'm using a relational database that needs to be rigorously tested for
internal consistency. In this case, it's a sports statistics database
with player stats that are updated nightly.

I need to run tests like the following when new data arrives each night:
--That the sum of player stats equals the team's.
--That the sum of team stats equals the league's.
--That the sum of wins and losses equals games played.
--etc.

For now I'm copying my development database over to testing and running
these alongside my unit tests in the /test/models/ directory.

This is an awkward set-up as my database testing code isn't comprised of
unit tests in their proper sense, and it doesn't rely on fixtures as the
Rails documentation suggests this folder be used for.

My question is: In Rails, what is the best practice for database testing
like that which I describe above?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cf99087d2c5d3174a76bbe0fd09ddcdf%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment