Add support for not Active Record based factories
This commit is contained in:
parent
f2674c7b98
commit
d08de5ed0e
1 changed files with 12 additions and 4 deletions
|
@ -1,9 +1,17 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
FactoryGirl.factories.map(&:name).each do |factory_name|
|
describe 'factories' do
|
||||||
describe "#{factory_name} factory" do
|
FactoryGirl.factories.each do |factory|
|
||||||
it 'should be valid' do
|
describe "#{factory.name} factory" do
|
||||||
expect(build(factory_name)).to be_valid
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue