-
Notifications
You must be signed in to change notification settings - Fork 134
Installation
notahat edited this page Aug 23, 2010
·
7 revisions
In your app’s Gemfile
, in the group :test
section, add:
gem 'machinist', '>= 2.0.0.beta1'
Then run:
bundle install
rails generate machinist:install
If you want Machinist to automatically add a blueprint to your blueprints file whenever you generate a model, add the following to your config/application.rb
in the config.generators
section:
g.fixture_replacement :machinist
First, install the Machinist 2 gem:
gem install machinist --pre
Create a blueprints.rb
file to hold your blueprints in your spec/support
directory. It should start with:
require 'machinist/active_record'
In your spec/spec_helper.rb
, add this inside the Spec::Runner.configure
block:
config.before(:each) { Machinist.reset_before_test }
Create a blueprints.rb
file to hold your blueprints in your test
directory. It should start with:
require 'machinist/active_record'
In your test/test_helper.rb
, add this to the requires at the top of the file:
require File.expand_path(File.dirname(__FILE__) + "/blueprints")
and add this inside class ActiveSupport::TestCase
:
setup { Machinist.reset_before_test }