1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 12:50:24 +01:00

change the regex...to require the field be surrounded by whitespace?

The reason for the test was because some licenses had name and others had author, meaning in GitHub.com the inconsistency would cause the fields not to be interpolated.

Copied from https://github.com/github/choosealicense.com/pull/527#discussion_r140502928
This commit is contained in:
Ben Balter 2017-10-08 18:34:03 -07:00 committed by Mike Linksvayer
parent a792218c0f
commit d01065b09a

View File

@ -6,7 +6,7 @@ describe 'license fillable fields' do
licenses.each do |license|
context "The #{license['title']} license" do
it 'should only contain supported fillable fields' do
matches = license['content'].scan(/\[([a-z]+)\]/)
matches = license['content'].scan(/\s+\[([a-z]+)\]\s+/)
extra_fields = matches.flatten - (fields.map { |f| f['name'] })
expect(extra_fields).to be_empty
end