Installation - notahat/machinist GitHub Wiki
In your app’s Gemfile, in the group :test section, add:
gem 'machinist', '>= 2.0.0.beta2'Then run:
bundle install
rails generate machinist:installIf 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 :machinistFirst, install the Machinist 2 gem:
gem install machinist --preCreate 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 }