Skip to content

Instantly share code, notes, and snippets.

@JakubOboza
Created March 4, 2011 18:38
Show Gist options
  • Save JakubOboza/855463 to your computer and use it in GitHub Desktop.
Save JakubOboza/855463 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Cat do
describe "validations" do
it "should be valid" do
cat = Cat.new(:name => "panther", :url => "http://great.panther.com/pan.jpg")
cat.should be_valid
end
it "should not be valid" do
Cat.new.should_not be_valid
end
end # end of validations describe
end
class Cat
include Mongoid::Document
field :name
field :url, :type => String
end
$> rake spec
Pending:
Application should earn loads of money
# Not Yet Implemented
# ./spec/application_spec.rb:6
Failures:
1) Cat validations should not be valid
Failure/Error: Cat.new.should_not be_valid
expected valid? to return false, got true
# ./spec/models/cat_spec.rb:13
Finished in 0.00357 seconds
3 examples, 1 failure, 1 pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment