Created
March 24, 2010 07:58
-
-
Save frosty/342086 to your computer and use it in GitHub Desktop.
This file contains 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 'test_helper' | |
class FicTest < ActiveSupport::TestCase | |
fixtures :all | |
should_belong_to :user | |
should_belong_to :story | |
test "should validate presence of content" do | |
assert_raise (ActiveRecord::RecordInvalid) { | |
@fic = Fic.make(:content => nil) | |
} | |
end | |
test "should validate content length" do | |
assert_raise (ActiveRecord::RecordInvalid) { | |
@fic = Fic.make(:content => "Three words long", | |
:story => Story.make(:fic_length => 2, | |
:fic_length_enforce => true)) | |
} | |
end | |
test "should save a valid fic" do | |
fic = Fic.make | |
assert fic.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment