Commit d08de5ed authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add support for not Active Record based factories

parent f2674c7b
require 'spec_helper'
FactoryGirl.factories.map(&:name).each do |factory_name|
describe "#{factory_name} factory" do
it 'should be valid' do
expect(build(factory_name)).to be_valid
describe 'factories' do
FactoryGirl.factories.each do |factory|
describe "#{factory.name} factory" do
let(:entity) { build(factory.name) }
it 'does not raise error when created 'do
expect { entity }.to_not raise_error
end
it 'should be valid', if: factory.build_class < ActiveRecord::Base do
expect(entity).to be_valid
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment