debian-mirror-gitlab/spec/factories_spec.rb
2020-06-23 00:09:42 +05:30

25 lines
706 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'factories' do
FactoryBot.factories.each do |factory|
describe "#{factory.name} factory" do
it 'does not raise error when built' do
expect { build(factory.name) }.not_to raise_error
end
it 'does not raise error when created' do
expect { create(factory.name) }.not_to raise_error
end
factory.definition.defined_traits.map(&:name).each do |trait_name|
describe "linting #{trait_name} trait" do
skip 'does not raise error when created' do
expect { create(factory.name, trait_name) }.not_to raise_error
end
end
end
end
end
end