version: 2

models:
  # this whole model should fail and not run
  - name: table_copy
    description: "A copy of the table"
    columns:
      - name: id
        description: "The ID"
        tests:
          - not_null
          - unique
      - name: favorite_color
        tests:
          # this is missing a "-" and is malformed
          accepted_values: { values: ['blue', 'green'] }

  # this whole model should pass and run
  - name: table_summary
    description: "The summary table"
    columns:
      - name: favorite_color
        description: "The favorite color"
        tests:
          - not_null
          - unique
          - accepted_values: { values: ['blue', 'green'] }
          - relationships: { field: favorite_color, to: ref('table_copy') }
      - name: count
        description: "The number of responses for this favorite color"
        tests:
          - not_null
