зеркало из https://github.com/github/explore.git
Add test to ensure users and organizations exist
This commit is contained in:
Родитель
5d2282cfd4
Коммит
0012629489
|
@ -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")
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче