Merge branch 'master' into 3586-job-priority
[arvados.git] / services / api / test / functional / arvados / v1 / schema_controller_test.rb
1 require 'test_helper'
2
3 class Arvados::V1::SchemaControllerTest < ActionController::TestCase
4
5   test "should get fresh discovery document" do
6     MAX_SCHEMA_AGE = 60
7     get :index
8     assert_response :success
9     discovery_doc = JSON.parse(@response.body)
10     assert_equal 'discovery#restDescription', discovery_doc['kind']
11     assert_equal(true,
12                  Time.now - MAX_SCHEMA_AGE.seconds < discovery_doc['generatedAt'],
13                  "discovery document was generated >#{MAX_SCHEMA_AGE}s ago")
14   end
15
16 end