Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Missing spec for 1-types-validation #1

@iarie

Description

@iarie

Hey @timriley, just started to explore workshop-app and i liked it!
1-types-validation: I guess there is a missing spec for this exercise:

Add a high-level rule to validate that published_at is filled only when status is set to "published"

like so:

it "rejects published_at if status is not 'published'" do
  result = schema.({title: "my article", status: "draft", published_at: Time.now}))
  expect(result).to be_failure
  expect(result.messages[:published_at_then_published].length).to eq 1
end

Or maybe make it xit and left as optional to encourage to implement rspec example

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions