3 class UserTest < ActiveSupport::TestCase
4 test "get owned_items" do
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}")