Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 20 lines (15 sloc) 0.377 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
require "spec_helper"

describe "skipping the default create" do
  before do
    define_model("User", email: :string)

    FactoryGirl.define do
      factory :user do
        skip_create

        email "john@example.com"
      end
    end
  end

  it "doesn't execute anything when creating the instance" do
    expect(FactoryGirl.create(:user)).not_to be_persisted
  end
end
Something went wrong with that request. Please try again.