2015-08-22 21:25:16 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-02-08 21:37:19 +01:00
|
|
|
describe 'license categories' do
|
2016-01-20 16:20:04 +01:00
|
|
|
families.each do |family|
|
|
|
|
context "the #{family} family" do
|
2016-02-08 21:37:19 +01:00
|
|
|
family_licenses = licenses.select { |l| l['family'] == family }
|
|
|
|
primary = family_licenses.select { |l| l['variant'] == false }
|
|
|
|
variants = family_licenses.select { |l| l['variant'] == true }
|
2015-08-22 21:25:16 +02:00
|
|
|
|
2016-02-08 21:37:19 +01:00
|
|
|
it 'should only have one primary license' do
|
2016-01-20 16:20:04 +01:00
|
|
|
expect(primary.count).to eql(1)
|
|
|
|
end
|
2015-08-22 21:25:16 +02:00
|
|
|
|
2016-02-08 21:37:19 +01:00
|
|
|
it 'all other licenses should be variants' do
|
2016-01-20 16:20:04 +01:00
|
|
|
expected = family_licenses.count - 1
|
|
|
|
expect(variants.count).to eql(expected)
|
|
|
|
end
|
2015-08-22 21:25:16 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|