Max Williams wrote:
> I've just started using Selenium with Rspec and it's working well so
> far.  However, i'm testing it against my local development version of
> the site (ie running in mongrel).  What i really need to do is run it in
> a test environment, so i can do destructive actions repeatedly.

Investigate Webrat (and ots Selenium bindings if you need them). 
Cucumber may also be nice here.

> 
> Using fixtures seems like one obvious way to go

The obvious is not always the best. :)

[...]
>   a) Generate fixtures, or some data (maybe even just an sql file) that
> is loaded into the db before every test.  This is going to be very slow
> as the data will be reloaded *a lot*.

Remember, Rspec already clears the test database before each test.

What you have here is a good use case for factories, I think.  Install 
Machinist or Factory Girl and just tell it what you need for each 
particular test.  It will take care of the dependencies.
[...]
> 2) Generate a lot of fixtures somehow using some kind of system that
> basically makes it easier to have a lot of associated models.

This is sort of what factories do.  There's a Railscast on the subject.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to