Added ability to select which fields to return, instead of always returning all fields.
[arvados.git] / services / api / test / integration / select_test.rb
1 require 'test_helper'
2
3 class SelectTest < ActionDispatch::IntegrationTest
4   test "should select just two columns" do
5     get "/arvados/v1/links", {:format => :json, :select => ['uuid', 'link_class']}, auth(:active)
6     assert_response :success
7     assert_equal json_response['items'].count, json_response['items'].select { |i|
8       i['uuid'] != nil and i['link_class'] != nil and i['head_uuid'] == nil and i['tail_uuid'] == nil
9     }.count
10   end
11
12 end