Add test to ensure users and organizations exist

This commit is contained in:
Tal Safran 2018-03-06 16:37:06 -08:00
Родитель 5d2282cfd4
Коммит 0012629489
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -32,6 +32,17 @@ describe "collections" do
assert_empty invalid_slugs, "Invalid item slugs #{invalid_slugs}" assert_empty invalid_slugs, "Invalid item slugs #{invalid_slugs}"
end end
it "does not include items pointing to non-existent users or organizations" do
items_for_collection(collection).each do |item|
next unless item.match?(USERNAME_REGEX)
user_url = URI("https://api.github.com/users/#{item}")
response = Net::HTTP.get_response(user_url)
assert response.code == 200, "user or organization #{item} does not exist"
end
end
it "has an index.md" do it "has an index.md" do
path = File.join(collections_dir, collection, "index.md") path = File.join(collections_dir, collection, "index.md")