Topic: Using Machinist in Model Specs Test

I am trying to use Machinist 1.0.6 in my RSpec model spec test.

If I am running a test that creates a valid object then I can use Project.make to create an object that passes, see the first and third test below.

If I run a test that results in an invalid object like the second and fourth test below, I get an error instead of a failed test.
It is the correct error from the object, I am wondering why it is throwing an error instead of failing the test.

If I switch from Project.make to then everything works as expected.

ActiveRecord::RecordInvalid: Validation failed: Boli You must select Yes or No!
-e:1:in `load'

  it "should create a new instance given valid attributes" do
  project = Project.make
  project.should be_valid

  it "is not valid without boli" do
  # project = Project.make(:boli => nil)
  project = => nil)
  project.should_not be_valid

  it "is valid if boli is false" do
  project = Project.make(:boli => false, :site_id => 1, :code => "abc", :name => "abc" )
  project.should be_valid

  it "should require valid boli values if boli is true" do
  # project = Project.make(:boli => true)
  project = => true)
  project.should have(1).error_on(:daylength)
  project.should have(1).error_on(:rate)
  project.should have(1).error_on(:fringe)
  project.should have(1).error_on(:location)
  project.should have(1).error_on(:county)
  project.should have(1).error_on(:advertised)