Module: GdsApi::TestHelpers::FinderApi

Defined in:
lib/gds_api/test_helpers/finder_api.rb

Constant Summary collapse

FINDER_API_ENDPOINT =
Plek.current.find('finder-api')

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.schema_fixtureObject



14
15
16
17
18
19
20
21
# File 'lib/gds_api/test_helpers/finder_api.rb', line 14

def self.schema_fixture
  File.read(
    File.expand_path(
      "../../../../test/fixtures/finder_api/cma-case-schema.json",
      __FILE__
    )
  )
end

Instance Method Details

#finder_api_has_schema(finder_slug, schema_fixture = FinderApi.schema_fixture) ⇒ Object



8
9
10
11
12
# File 'lib/gds_api/test_helpers/finder_api.rb', line 8

def finder_api_has_schema(finder_slug, schema_fixture = FinderApi.schema_fixture)
  stub_request(:get, "#{FINDER_API_ENDPOINT}/finders/#{finder_slug}/schema.json")
    .with(:headers => {'Content-Type'=>'application/json'})
    .to_return(:status => 200, :body => schema_fixture)
end