2014-09-02 18:07:02 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
describe 'factories' do
|
|
|
|
FactoryGirl.factories.each do |factory|
|
|
|
|
describe "#{factory.name} factory" do
|
|
|
|
let(:entity) { build(factory.name) }
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
it 'does not raise error when created' do
|
|
|
|
expect { entity }.not_to raise_error
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
it 'is valid', if: factory.build_class < ActiveRecord::Base do
|
2016-06-02 11:05:42 +05:30
|
|
|
expect(entity).to be_valid
|
|
|
|
end
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|