On Thu, Mar 3, 2011 at 2:56 PM, Jason Lewis
<jasonlewis.x-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>
> I''ve been trying to Google for an answer to this, but the
suggestions I''ve
> found have been either contradictory or seemingly outdated.
>
> I''m building a Rails frontend for a legacy Oracle database, and I
want to
> do proper tests with RSpec/Cucumber. What I can''t seem to figure
out is how
> to run tests without destroying and rebuilding the database.
>
I would recommend isolating your test data. Ideally put it into something
like Factories (Factory Girl, Machinist,etc) as much as possible. Try to
focus in specifically on exactly what you are testing. I am not the best
example (yet) but my current project has also shown me why it is good to
mock and stub rather than depend on data (I am dealing with legacy data).
As for the db -- couldn''t you just backup the oracle db and dump the
data
out of it? I am assuming you are using the legacy schema and not the rails
schema way of doing things. Ideally get to an empty db that you can tell
your test suite to recreate each time you run your tests.
I''m well aware that that''s the ''best
practice'' way of doing it... but I''m> dealing with a massive, >6GB beast with hundreds of tables, byzantine
> constraints, and a rat''s nest of spaghetti code in the form of
triggers and
> stored procs.
>
> Seriously, I have nightmares about this database as well.
>
> But, I''ve been slogging away at it, and created a web app
that''s impressed
> the bosses, and the vendor for that matter. But I also have nightmares
about
> the fact that I don''t have a test suite. This horrifies me.
>
> What I''d like to do is test against the dev db, since if it gets
horribly
> b0rked, I can restore from the previous night''s ComVault backup.
>
> I saw the suggestion to edit the rake task in the old rspec_on_rails plugin
> so that
>
> spec_prereq = :noop
>
> I was curious if there was a good way to do this with the current
> rspec-rails gem...
>
> I''m on Ruby 1.9.2 and Rails 3.0.4
>
> Thanks,
>
> Jason Lewis
>
> Email jasonlewis.x-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
>
> Mobile 414.310.2665
>
> Blog: http://duckpunching.wordpress.com/
>
> --
> 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.
>
--
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.