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

Missing spec for 1-types-validation #1

Open
iarie opened this issue Nov 23, 2017 · 0 comments
Open

Missing spec for 1-types-validation #1

iarie opened this issue Nov 23, 2017 · 0 comments

Comments

@iarie
Copy link

iarie commented Nov 23, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant