Add explanation comments to assertions.
[arvados.git] / apps / workbench / test / unit / user_test.rb
1 require 'test_helper'
2
3 class UserTest < ActiveSupport::TestCase
4   test "get owned_items" do
5     use_token :active
6     oi = User.find(api_fixture('users')['active']['uuid']).owned_items
7     assert_operator(0, :<, oi.count,
8                     "Expected to find some items belonging to :active user")
9     assert_operator(0, :<, oi.items_available
10                     "Expected owned_items response to have items_available > 0")
11     oi_uuids = oi.collect { |i| i['uuid'] }
12     expect = api_fixture('specimens')['owned_by_active_user']['uuid']
13     assert_includes(oi_uuids, expect,
14                     "Expected active user's owned_items to include #{expect}")
15   end
16 end