Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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.
Add Comment
Please, Sign In to add comment