#
# Explore and cover resources API with gabbi tests when there are no
# resources.
#

fixtures:
    - ConfigFixture

tests:

# Check for a list of resources, modifying the request in various
# ways.

    - name: list resources no extra
      desc: Provide no additional header guidelines
      url: /v2/resources
      response_headers:
          content-type: /application/json/
      response_strings:
          - "[]"

    - name: list resources but get url wrong
      url: /v2/resrces
      status: 404

    - name: list resources explicit accept
      url: /v2/resources
      request_headers:
          accept: application/json
      response_strings:
          - "[]"

    - name: list resources bad accept
      url: /v2/resources
      request_headers:
          accept: text/plain
      status: 406

    - name: list resources with bad query field
      url: /v2/resources?q.field=id&q.value=cars
      status: 400
      response_strings:
          - unrecognized field in query

    - name: list resources with query
      url: /v2/resources?q.field=resource&q.value=cars
      response_strings:
          - "[]"

    - name: list resource bad type meter links
      url: /v2/resources?meter_links=yes%20please
      status: 400
      response_strings:
          - unable to convert to int

    - name: list resource meter links int
      url: /v2/resources?meter_links=0
      response_strings:
          - "[]"
