Created
March 4, 2011 18:38
-
-
Save JakubOboza/855463 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Cat | |
include Mongoid::Document | |
field :name | |
field :url, :type => String | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> 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