Created
November 19, 2008 15:49
-
-
Save maxim/26546 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
# The test | |
setup do | |
@asset = Asset.new({:kind => 'image', | |
:user_rights => 3, | |
:everyone_rights => 1, | |
:description => "nice dragon", | |
:object => File.new(File.expand_path(File.dirname(__FILE__) + '/asset_test/dragon.svg')) | |
}) | |
end | |
should "be of correct kind" do | |
@asset.kind = "fluffyhorse" | |
assert_raises ActiveRecord::StatementInvalid do | |
@asset.save | |
end | |
end | |
# Expected result | |
# PASS - Database should catch that kind 'fluffyhorse' isn't allowed due to constraint. | |
# Actual result | |
# FAIL - <ActiveRecord::StatementInvalid> exception expected but none was thrown. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment