Guest User

Untitled

a guest
Feb 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. # The test
  2. setup do
  3. @asset = Asset.new({:kind => 'image',
  4. :user_rights => 3,
  5. :everyone_rights => 1,
  6. :description => "nice dragon",
  7. :object => File.new(File.expand_path(File.dirname(__FILE__) + '/asset_test/dragon.svg'))
  8. })
  9. end
  10.  
  11. should "be of correct kind" do
  12. @asset.kind = "fluffyhorse"
  13. assert_raises ActiveRecord::StatementInvalid do
  14. @asset.save
  15. end
  16. end
  17.  
  18. # Expected result
  19. # PASS - Database should catch that kind 'fluffyhorse' isn't allowed due to constraint.
  20.  
  21. # Actual result
  22. # FAIL - <ActiveRecord::StatementInvalid> exception expected but none was thrown.
Add Comment
Please, Sign In to add comment