2016-01-20 16:37:44 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-02-08 21:37:19 +01:00
|
|
|
describe 'shown licenses' do
|
2016-01-20 16:37:44 +01:00
|
|
|
# Whitelist of popular licenses that are shown (non-hidden)
|
|
|
|
# Note: most new licenses that are added should be hidden by default
|
2016-02-08 21:37:19 +01:00
|
|
|
SHOWN_LICENSES = %w(
|
2016-01-20 16:37:44 +01:00
|
|
|
agpl-3.0
|
|
|
|
apache-2.0
|
|
|
|
artistic-2.0
|
|
|
|
bsd-2-clause
|
|
|
|
bsd-3-clause
|
|
|
|
cc0-1.0
|
|
|
|
epl-1.0
|
|
|
|
gpl-2.0
|
|
|
|
gpl-3.0
|
|
|
|
isc
|
|
|
|
lgpl-2.1
|
|
|
|
lgpl-3.0
|
|
|
|
mit
|
|
|
|
mpl-2.0
|
|
|
|
unlicense
|
2016-02-08 21:37:19 +01:00
|
|
|
).freeze
|
2016-01-20 16:37:44 +01:00
|
|
|
|
2016-02-08 21:37:19 +01:00
|
|
|
it 'has the expected number of shown licenses' do
|
2016-01-26 22:42:29 +01:00
|
|
|
expect(shown_licenses.count).to eql(15)
|
2016-01-20 16:37:44 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
shown_licenses.each do |license|
|
2016-02-08 21:37:19 +01:00
|
|
|
context "the #{license['title']} license" do
|
|
|
|
it 'is whitelisted to be shown' do
|
|
|
|
expect(SHOWN_LICENSES).to include(license['id'])
|
2016-01-20 16:37:44 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|