machinist

Machinist vs FactoryGirl - pros and cons

Hi, I'm working with factory_girl, but looking at the machinist gem. Could you tell me please - what are the pros and cons of migrating to machinist? Have you compared those libs? ...

Error when logging in with Machinist in Shoulda test

I am having some trouble getting the right usage of Machinist and Shoulda in my testing. Here is my test: context "on POST method rating" do p = Product.make u = nil setup do u = login_as post :vote, :rating => 3, :id => p end should "set rating for product to 3" do assert_equal p.get_user_vote(u), 3 end And here's my bluepri...

RSpec + Machinist. auto_increment issue

By default, "rake specs" re-creating my test database, using environment's one. It removes all the data, but not the the auto_increment. So when i'll try to make a new user: User.blueprint do login { Sham.login } email { Sham.email } end # the test: user = User.make user.id.should == 1 It says, that ID was 1800 (auto_increment w...

Named Blueprints with factory_girl

I am using Factory Girl but like the machinist syntax. So I wonder, if there is any way creating a named blueprint for class, so that I can have something like that: User.blueprint(:no_discount_user) do admin false hashed_password "226bc1eca359a09f5f1b96e26efeb4bb1aeae383" is_trader false name "foolish...

How do I get cucumber and pickle working with mongo_mapper, machinist, and machinist_mongo?

I would like to get machinist, machinist_mongo, mongo_mapper, cucumber and pickle to play nice together. Currently I have machinist with all my blueprints configured and am using cucumber to do BDD. So far so good. My problem is I am having to write custom cucumber steps for all of my machinist blueprints. It is not really a problem per...

How to use named Machinist blueprints in Cucumber with Pickle

I noticed this little tid-bit in the readme for pickle: (The latest version of pickle supports multiple blueprints, for earlier versions of machinist use pickle <= 0.1.10) I'm running in to a situation where I want to create a user with admin privileges. I've got two machinist blueprints: User.blueprint do first_name last_name ...

Mongoid with Machinist

I am using machinist and mongoid. How can I generate blueprint for embeds_many association. Mongoid embeds_many association embeds the hash of array. So I just started like this: User.blueprint do address { :address1 => "address", :address2 => 'next address'} end Any Ideas? ...

Machinist for Non-ActiveRecord Models

Is it possible to use Machinist to create blueprints for non-activerecord models? Seems to generate an error no matter what I try! If this is impossible with Machinist, is there another fixture generating gem that can do it? I've also read that Factory Girl has issues with this. ...