2017-01-18 22:31:19 +01:00
|
|
|
# frozen_string_literal: true
|
2017-03-27 02:19:44 +02:00
|
|
|
|
2016-06-14 19:35:44 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'shown licenses' do
|
|
|
|
# Whitelist of popular licenses that are shown (non-hidden)
|
|
|
|
# Note: most new licenses that are added should be hidden by default
|
2017-04-09 07:40:27 +02:00
|
|
|
SHOWN_LICENSES = %w[
|
2016-06-14 19:35:44 +02:00
|
|
|
agpl-3.0
|
|
|
|
apache-2.0
|
2016-09-26 20:20:44 +02:00
|
|
|
bsd-2-clause
|
|
|
|
bsd-3-clause
|
2019-11-20 17:11:57 +01:00
|
|
|
cc0-1.0
|
2017-11-24 23:15:52 +01:00
|
|
|
epl-2.0
|
2016-09-26 20:20:44 +02:00
|
|
|
gpl-2.0
|
2016-06-14 19:35:44 +02:00
|
|
|
gpl-3.0
|
2016-09-26 20:20:44 +02:00
|
|
|
lgpl-2.1
|
2016-06-14 19:35:44 +02:00
|
|
|
mit
|
|
|
|
mpl-2.0
|
|
|
|
unlicense
|
2017-04-09 07:40:27 +02:00
|
|
|
].freeze
|
2016-06-14 19:35:44 +02:00
|
|
|
|
|
|
|
it 'has the expected number of shown licenses' do
|
2019-12-24 22:51:15 +01:00
|
|
|
expect(shown_licenses.count).to eql(12)
|
|
|
|
expect(SHOWN_LICENSES.count).to eql(shown_licenses.count)
|
2016-06-14 19:35:44 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
shown_licenses.each do |license|
|
|
|
|
context "the #{license['title']} license" do
|
|
|
|
it 'is whitelisted to be shown' do
|
|
|
|
expect(SHOWN_LICENSES).to include(license['spdx-lcase'])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|