[rspec-users] Testing url_for

Rodrigo Rosenfeld Rosas lbocseg at yahoo.com.br
Wed Oct 28 06:08:28 EDT 2009

Em 28-10-2009 00:21, David Chelimsky escreveu:
>> ...
>> Actually, I've taken a look at Factory Girl, but prefered Machinist, 
>> which is awesome. I'll take a look at Fixjour and Fixture 
>> Replacement. Do they have a blueprint-like feature?
>> I have no problem in creating methods in ActiveRecord::Base. I just 
>> wanted to call something like:
>> User.make_without_blueprint(:email => 'test at test.com', :active => 
>> 'false')
> How about make_inactive and put it directly on User?
> Also, there may be some sort of named blueprint feature. I'm not in a 
> position to look that up right now, but I think I remember that being 
> supported. If not, we should make it so :)

Thank you for making me going back to my first try. It is a long story:

The first thing I tried out was:

User.create(:active => false, :email => 'test at test.com')

At that time it didn't work because the user was being persisted and the 
next time I was running the test it gived me an error because of 
duplicate e-mail.

I associated that User.make would act diferently, turning on the 
rollback, but actually I figured out later that the problem was that I 
was calling it from before(:all). When I changed to before(:each) I had 
already created a named blueprint that reset the other fields generated 
by the default blueprint.

After reading your message, I came back to my original try and guess 
what: It works! :)

The problem was the before(:all) that I tried at the beggining...

Thank you once more,


Faça ligações para outros computadores com o novo Yahoo! Messenger 

More information about the rspec-users mailing list