BigW Consortium Gitlab

factories_spec.rb 411 Bytes
Newer Older
1 2
require 'spec_helper'

3 4 5 6 7
describe 'factories' do
  FactoryGirl.factories.each do |factory|
    describe "#{factory.name} factory" do
      let(:entity) { build(factory.name) }

8
      it 'does not raise error when created' do
9
        expect { entity }.not_to raise_error
10 11
      end

12
      it 'is valid', if: factory.build_class < ActiveRecord::Base do
13 14
        expect(entity).to be_valid
      end
15 16 17
    end
  end
end