Adnan Pirota
Adnan Pirota

Reputation: 309

How to write should_not be_valid with expect syntax

I am doing some tests while following codeschool course on rspec and I don't know how to write model validation for presence with expect syntax. If I write:

expect(user).should_not be_valid 

rspec is telling me to use expect instead of should_not. But I can not find how to write the right expression to check validation.

Upvotes: 2

Views: 1146

Answers (1)

Fer
Fer

Reputation: 3347

The expect syntax should be

expect(user).not_to be_valid 

Upvotes: 5

Related Questions