Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (15 sloc) 0.45 kb
require 'spec_helper'
describe 'defining methods inside FactoryGirl' do
it 'raises with a meaningful message' do
define_model('User')
expect do
FactoryGirl.define do
factory :user do
def generate_name
'John Doe'
end
end
end
end.to raise_error FactoryGirl::MethodDefinitionError, /Defining methods in blocks \(trait or factory\) is not supported \(generate_name\)/
end
end
Jump to Line
Something went wrong with that request. Please try again.