Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require "spec_helper"
- describe Contact do |v|
- it "is valid with a firstname, lastname and email" do
- c = Contact.new(
- firstname: "joe",
- lastname: "smith",
- email: "[email protected]")
- expect(c).to be_valid
- end
- it "is invalid without a firstname" do
- expect(Contact.new(firstname: nil)).to_have(1).errors_on(:firstname)
- end
- it "is invalid without a lastname"
- it "is invalid without an email address"
- it "is invalid without a duplicate email address"
- it "returns a contact's full name as a string"
- end
- /*** BUNDLE EXEC RSPEC ***/
- Failures:
- 1) Contact is invalid without a firstname
- Failure/Error: expect(Contact.new(firstname: nil)).to_have(1).errors_on(:firstname)
- NoMethodError:
- undefined method `to_have' for #<RSpec::Expectations::ExpectationTarget:0xb3068ac>
- # ./spec/models/contact_spec.rb:14:in `block (2 levels) in <top (required)>'
- Finished in 0.03346 seconds
- 6 examples, 1 failure, 4 pending
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement