require 'test_helper'

class FinderSchemaValidationTest < ActiveSupport::TestCase
  test "the people finder is a valid finder" do
    people_finder = JSON.parse(File.read("lib/finders/people.json"))

    assert_valid_against_schema(people_finder, 'finder')
  end
end

require 'test_helper'

class FinderSchemaValidationTest < ActiveSupport::TestCase
  FINDER_FILES = Dir[Rails.root + "lib/finders/*.json"]

  FINDER_FILES.each do |file_path|
    name = File.basename(file_path, '.json')

    test "the #{name} finder is a valid finder" do
      finder = JSON.parse(File.read(file_path))

      assert_valid_against_schema(finder, 'finder')
    end
  end
end

Test all the existing finders
Test all the existing finders

The Finding Things Team is working towards moving some of the index
pages to finders. This commit will make it easier to continue adding new
finders and be sure they are tested and valid.
