Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to master: Release 2.3.2 - Submissions endpoint pagination and … #3

Closed
wants to merge 116 commits into from
Closed
Changes from 5 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
a312109
add request_lang middleware
syphax-bouazzouni Mar 6, 2023
207884b
pin redis gem version to 4.8.1
syphax-bouazzouni Mar 6, 2023
c4c6be1
Merge branch 'fix/bundle-update-redis-breaks-tests' into development
syphax-bouazzouni Mar 6, 2023
9ea1770
Merge branch 'development' into feature/support-multilingual-read-one…
syphax-bouazzouni Mar 6, 2023
ae23ce0
update Gemfile.lock
syphax-bouazzouni Mar 6, 2023
5a41c91
Merge pull request #32 from ontoportal-lirmm/feature/support-multilin…
syphax-bouazzouni Mar 6, 2023
be31e4f
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 7, 2023
77bde06
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 7, 2023
0d8e4fd
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 7, 2023
aed3bf5
update Gemfile to use ontologies_linked_data new metadata branch
syphax-bouazzouni Mar 20, 2023
f0f56a6
update TestOntologySubmissionsController to be adapted to the new model
syphax-bouazzouni Mar 20, 2023
6699ae3
Merge branch 'feature/update-submission-mdetamodel-2023' into develop…
syphax-bouazzouni Mar 20, 2023
535e96e
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 20, 2023
7320f50
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 20, 2023
62f5831
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Mar 21, 2023
e259c1c
in submission_metadata rename display with category
syphax-bouazzouni Mar 21, 2023
2bf3ac8
add to submission_metadata description and example fields
syphax-bouazzouni Mar 21, 2023
b4d3536
Merge branch 'feature/update-submission-mdetamodel-2023' into develop…
syphax-bouazzouni Mar 21, 2023
ab8c876
add the option to do pagination for the submission endpoint
syphax-bouazzouni Apr 26, 2023
c6454e4
extract retrieve_latest_submissions method to submission helper
syphax-bouazzouni Apr 26, 2023
f1b1234
implement apply_filters to submissions endpoint using SPARQL FILTERs
syphax-bouazzouni Apr 26, 2023
64e7286
add test for submissions endpoint pagination
syphax-bouazzouni Apr 28, 2023
2cb2099
Merge pull request #34 from ontoportal-lirmm/feature/paginate-and-fil…
syphax-bouazzouni Apr 28, 2023
7e86f58
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Apr 28, 2023
1b7d514
fix private only submission filter
syphax-bouazzouni Apr 30, 2023
4cb42d0
add hasFormalityLevel filter for submissions endpoint
syphax-bouazzouni May 1, 2023
864e42f
add for ontology: reviews, notes, projects on the submissions endpoints
syphax-bouazzouni May 1, 2023
0497193
bring submission metrics for submissions endpoints
syphax-bouazzouni May 1, 2023
3abc430
bring all contact attributes if asked in the submissions endpoints
syphax-bouazzouni May 1, 2023
69ef8bd
refactor submissions endpoint filters by extracting some methods
syphax-bouazzouni May 1, 2023
1655473
add ontology acronym or name filters for submissions endpoints
syphax-bouazzouni May 1, 2023
060ed26
add submissions endpoint order_by option
syphax-bouazzouni May 1, 2023
b6e6434
Merge branch 'development' into feature/paginate-and-filter-ontologie…
syphax-bouazzouni May 1, 2023
b026d97
Merge pull request #36 from ontoportal-lirmm/feature/paginate-and-fil…
syphax-bouazzouni May 1, 2023
059d7e1
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm May 1, 2023
3f29887
fix including ontology and contacts in the submissions endpoints
syphax-bouazzouni May 1, 2023
198adbd
Merge remote-tracking branch 'origin/feature/paginate-and-filter-onto…
syphax-bouazzouni May 1, 2023
384d0ba
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 1, 2023
b45618a
fix list admin filter_access control (e.g for submissions endpoints)
syphax-bouazzouni May 1, 2023
8657066
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 1, 2023
b1e9ddf
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm May 1, 2023
34f19a3
check access of ontologies in /ontologies/:acronym/submissions endpoint
syphax-bouazzouni May 1, 2023
c942f87
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 1, 2023
42dfb9b
Merge remote-tracking branch 'origin/development' into development
syphax-bouazzouni May 1, 2023
d5dcb9e
include ontology viewOf attribute in the submission endpoints
syphax-bouazzouni May 2, 2023
2e06a69
Merge branch 'feature/paginate-and-filter-ontologies-endpoint' into d…
syphax-bouazzouni May 2, 2023
57d1a1e
make apply_filters helper generic for any of model attributes
syphax-bouazzouni Jun 15, 2023
dd26aac
add Agents controller
syphax-bouazzouni Jun 15, 2023
76db662
add pagination to agents index endpoint if asked
syphax-bouazzouni Jun 15, 2023
49d4ab4
make agents routes work for /Agent and /agent
syphax-bouazzouni Jun 15, 2023
0ddc5de
handle agent indentifiers and affiliations attributes save and update
syphax-bouazzouni Jun 16, 2023
f7c9bb9
make agent controller work for affiliations attribute
syphax-bouazzouni Jun 18, 2023
3375586
add agent controller tests
syphax-bouazzouni Jun 18, 2023
c785dfc
don't update affiliations if only 'id' sent in params
syphax-bouazzouni Jun 27, 2023
09a7eb7
bring identifier attributes when we update an agent
syphax-bouazzouni Jul 5, 2023
cf74166
update agent test to work with the new Agent validators
syphax-bouazzouni Jul 5, 2023
070b1fb
bring the agent attributes on display all of the submissions endpoints
syphax-bouazzouni Jul 30, 2023
f0da26e
handle exception for class attribute but aren't in populate_from_params
syphax-bouazzouni Jul 31, 2023
f378950
update Gemfile to use development branch of OLD
syphax-bouazzouni Aug 1, 2023
3d05980
refactor user controller to extract reset password helpers
syphax-bouazzouni Aug 3, 2023
ae6bdd5
remove the send notification on user creation, now handled by user.save
syphax-bouazzouni Aug 3, 2023
2cdd4ff
add access token authentication
syphax-bouazzouni Aug 3, 2023
54db3c0
fix test after enforcing the uniqueness of user emails
syphax-bouazzouni Aug 3, 2023
3d79e40
fix search test
syphax-bouazzouni Aug 3, 2023
ac6d356
add oauth_authentication test
syphax-bouazzouni Aug 4, 2023
fce1674
bring the correct attributes when the oauth_authenticate is used
syphax-bouazzouni Aug 6, 2023
3ac46f3
Merge pull request #41 from ontoportal-lirmm/feature/add-multiprovide…
syphax-bouazzouni Aug 21, 2023
1250a92
Merge branch 'development' into feature/add-agent-crud-endpoint
syphax-bouazzouni Sep 5, 2023
e85558a
Merge pull request #39 from ontoportal-lirmm/feature/add-agent-crud-e…
syphax-bouazzouni Sep 5, 2023
ff7650e
Feature: Add support of multilingual search (#40)
haddadzineddine Sep 5, 2023
13c9145
add get submission all including all properties test
syphax-bouazzouni Sep 14, 2023
62c7b0e
extract and use submission_include_params where we use submission.bring
syphax-bouazzouni Sep 15, 2023
5bf6a05
use retrieve_submissions helper in the :acronym/submissions endpoint
syphax-bouazzouni Sep 15, 2023
0962139
Merge branch 'development' into feature/paginate-and-filter-ontologie…
syphax-bouazzouni Sep 15, 2023
ea90027
update Goo version and add submissions filters test
syphax-bouazzouni Sep 21, 2023
d8c8e5b
Fix: display contact for get submissions (#45)
syphax-bouazzouni Sep 21, 2023
25d7f84
Merge branch 'development' into fix/submission-filters-endpoints
syphax-bouazzouni Sep 21, 2023
bd6494c
Fix: Submissions filters with order_by for the same attribute (#46)
syphax-bouazzouni Sep 21, 2023
47ffdab
make the ontology submissions endpoint include views
syphax-bouazzouni Oct 9, 2023
801b693
Merge branch 'fix/submission-filters-endpoints' into development
syphax-bouazzouni Oct 9, 2023
37408c5
Merge branch 'master' into development
syphax-bouazzouni Oct 12, 2023
1234096
Merge to master: Release 2.3.2 - Submissions endpoint pagination and …
syphax-bouazzouni Oct 19, 2023
9fb09a2
include all metrics attribues in the submissions endpoints (#53)
syphax-bouazzouni Oct 22, 2023
1602a31
add ontology submissions filter by status (#56)
syphax-bouazzouni Nov 1, 2023
01cdda4
add agent usage attribute tests (#55)
syphax-bouazzouni Nov 3, 2023
d8eb63a
Fix: optimize fetching all agents usages query by batch loading them …
syphax-bouazzouni Nov 8, 2023
1d13691
Feature: Add ontologies_api docker image build CI (#58)
syphax-bouazzouni Nov 13, 2023
0e559c5
Feature: add ontoportal bash script (#59)
syphax-bouazzouni Nov 22, 2023
00967ef
Feature: add ontoportal bash script (#59)
syphax-bouazzouni Nov 22, 2023
ac0d71b
Merge remote-tracking branch 'origin/development' into development
syphax-bouazzouni Nov 24, 2023
be861eb
fix date list properties population helper
syphax-bouazzouni Nov 26, 2023
708be2c
Feature: update ontoportal bash script to handle local gems binding …
syphax-bouazzouni Nov 28, 2023
14e9a2b
add description filter to the submissions endpoint (#62)
syphax-bouazzouni Nov 30, 2023
c791b3f
Merge pull request #41 from ontoportal-lirmm/feature/add-multiprovide…
syphax-bouazzouni Dec 5, 2023
7afc661
Merge to master: Release 2.3.4 - Multilingual (#42)
syphax-bouazzouni Dec 5, 2023
72813a0
Merge branch 'master' into development
syphax-bouazzouni Dec 5, 2023
e04096a
Merge to master: Release 2.3.5 - New metadata model (#43)
syphax-bouazzouni Dec 5, 2023
8f485b2
Merge to master - Release 2.3.6 - add Docker image (#35)
syphax-bouazzouni Dec 5, 2023
7d32a70
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Dec 12, 2023
b941c21
update API documentation to the language parameter to search
syphax-bouazzouni Dec 16, 2023
a05edfc
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Dec 16, 2023
165723b
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Dec 20, 2023
422cbb5
add analytics controller with endpoints for users, ontologies and pa…
syphax-bouazzouni Dec 28, 2023
2cabca4
Merge branch 'master' into development
syphax-bouazzouni Dec 28, 2023
286b56b
Merge pull request #64 from ontoportal-lirmm/development
syphax-bouazzouni Dec 28, 2023
4c2fe07
remove useless line preventing sending the reset password email (#65)
syphax-bouazzouni Jan 26, 2024
0fe2ffc
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Feb 7, 2024
b8436be
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm Feb 21, 2024
74c8db8
Update docker-image.yml to build master docker image
syphax-bouazzouni Mar 21, 2024
711b73a
fix: Update Dockerfile to work in ruby 2.7
syphax-bouazzouni Mar 31, 2024
2ac10a8
Merge to master: Release 2.4.0 - Multi-backend stores integrations, U…
syphax-bouazzouni May 22, 2024
a2cdc3c
[ontoportal-bot] Gemfile.lock update
ontoportal-bot-lirmm May 23, 2024
c8b7ac3
fix: use submit_search_query to call SOLR using POST not GET limited …
syphax-bouazzouni May 24, 2024
a694927
fix documentation raising an exception because cardinality doesn't exist
syphax-bouazzouni May 25, 2024
3cc0045
update config.sample to fix repository_folder default
syphax-bouazzouni Jun 5, 2024
15a90e6
Feature: Update docker compose to add ncbo cron (#80)
syphax-bouazzouni Jun 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ gem 'ncbo_annotator', git: 'https://github.com/ontoportal-lirmm/ncbo_annotator.g
gem 'ncbo_cron', git: 'https://github.com/ontoportal-lirmm/ncbo_cron.git', branch: 'master'
gem 'ncbo_ontology_recommender', git: 'https://github.com/ncbo/ncbo_ontology_recommender.git', branch: 'master'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'master'
gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'feature/migrate-attrbiutes-metadata-to-scheme-file'
gem 'ontologies_linked_data', git: 'https://github.com/ontoportal-lirmm/ontologies_linked_data.git', branch: 'development'

group :development do
# bcrypt_pbkdf and ed35519 is required for capistrano deployments when using ed25519 keys; see https://github.com/miloserdow/capistrano-deploy/issues/42
17 changes: 9 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: f9b73ce6b6fac92bffd0a2a1b9dc9ba9266acf79
revision: 1484ad56e39810208ee08a14d1319b6bc112f647
branch: development
specs:
goo (0.0.2)
@@ -53,8 +53,8 @@ GIT

GIT
remote: https://github.com/ontoportal-lirmm/ontologies_linked_data.git
revision: 1e6886bec9c0c07bf5bfaad51e095a04c5bd0197
branch: feature/migrate-attrbiutes-metadata-to-scheme-file
revision: f2168c8ad9ec447338da914d10a352df558494b5
branch: development
specs:
ontologies_linked_data (0.0.1)
activesupport
@@ -103,11 +103,11 @@ GEM
activesupport (3.2.22.5)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
addressable (2.8.1)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
airbrussh (1.4.1)
sshkit (>= 1.6.1, != 1.7.0)
backports (3.24.0)
backports (3.24.1)
bcrypt (3.1.18)
bcrypt_pbkdf (1.1.0)
bigdecimal (1.4.2)
@@ -171,7 +171,7 @@ GEM
retriable (>= 2.0, < 4.a)
rexml
webrick
googleauth (1.3.0)
googleauth (1.5.2)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
@@ -228,7 +228,7 @@ GEM
net-protocol
net-ssh (7.1.0)
netrc (0.11.0)
newrelic_rpm (9.0.0)
newrelic_rpm (9.2.0)
oj (2.18.5)
omni_logger (0.1.4)
logger
@@ -249,7 +249,7 @@ GEM
rack (>= 0.4)
rack-cors (1.0.6)
rack (>= 1.6.0)
rack-mini-profiler (3.0.0)
rack-mini-profiler (3.1.0)
rack (>= 1.2.0)
rack-protection (1.5.5)
rack
@@ -343,6 +343,7 @@ GEM
webrick (1.8.1)

PLATFORMS
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
10 changes: 7 additions & 3 deletions controllers/ontology_submissions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
class OntologySubmissionsController < ApplicationController
get "/submissions" do
check_last_modified_collection(LinkedData::Models::OntologySubmission)
#using appplication_helper method
options = {also_include_views: params["also_include_views"], status: (params["include_status"] || "ANY")}
reply retrieve_latest_submissions(options).values
options = {
also_include_views: params["also_include_views"],
status: (params["include_status"] || "ANY")
}
subs = retrieve_latest_submissions(options)
subs = subs.values unless page?
reply subs
end

##
38 changes: 8 additions & 30 deletions helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -355,40 +355,18 @@ def replace_url_prefix(id)
end

def retrieve_latest_submissions(options = {})
status = (options[:status] || "RDF").to_s.upcase
include_ready = status.eql?("READY") ? true : false
status = "RDF" if status.eql?("READY")
any = true if status.eql?("ANY")
include_views = options[:also_include_views] || false
includes = OntologySubmission.goo_attrs_to_load(includes_param)

includes << :submissionStatus unless includes.include?(:submissionStatus)
if any
submissions_query = OntologySubmission.where
else
submissions_query = OntologySubmission.where(submissionStatus: [ code: status])
end
submissions = retrieve_submissions(options)

submissions_query = submissions_query.filter(Goo::Filter.new(ontology: [:viewOf]).unbound) unless include_views
submissions_query = submissions_query.filter(filter) if filter?
# When asking to display all metadata, we are using bring_remaining on each submission. Slower but best way to retrieve all attrs
if includes_param.first == :all
includes = [:submissionId, {:contact=>[:name, :email], :ontology=>[:administeredBy, :acronym, :name, :summaryOnly, :ontologyType, :viewingRestriction, :acl,
:group, :hasDomain, :views, :viewOf, :flat], :submissionStatus=>[:code], :hasOntologyLanguage=>[:acronym]}, :submissionStatus]
end
submissions = submissions_query.include(includes).to_a

# Figure out latest parsed submissions using all submissions
latest_submissions = {}
latest_submissions = page? ? submissions : {} # latest_submission doest not work with pagination
submissions.each do |sub|
# To retrieve all metadata, but slow when a lot of ontologies
if includes_param.first == :all
sub.bring_remaining
sub.bring_remaining if includes_param.first == :all
unless page?
next if include_ready?(options) && !sub.ready?
next if sub.ontology.nil?
latest_submissions[sub.ontology.acronym] ||= sub
latest_submissions[sub.ontology.acronym] = sub if sub.submissionId.to_i > latest_submissions[sub.ontology.acronym].submissionId.to_i
end
next if include_ready && !sub.ready?
next if sub.ontology.nil?
latest_submissions[sub.ontology.acronym] ||= sub
latest_submissions[sub.ontology.acronym] = sub if sub.submissionId.to_i > latest_submissions[sub.ontology.acronym].submissionId.to_i
end
latest_submissions
end
51 changes: 51 additions & 0 deletions helpers/request_params_helper.rb
Original file line number Diff line number Diff line change
@@ -13,6 +13,10 @@ def settings_params(klass)
[attributes, page, size, order_by, bring_unmapped]
end

def page?
!params[:page].nil?
end

def is_set?(param)
!param.nil? && param != ""
end
@@ -25,6 +29,53 @@ def filter
build_filter
end

def apply_filters(query)

filters = {
naturalLanguage: params[:naturalLanguage]&.split(',') , #%w[http://lexvo.org/id/iso639-3/fra http://lexvo.org/id/iso639-3/eng],
hasOntologyLanguage_acronym: params[:hasOntologyLanguage]&.split(',') , #%w[OWL SKOS],
ontology_hasDomain_acronym: params[:hasDomain]&.split(',') , #%w[Crop Vue_francais],
ontology_group_acronym: params[:group]&.split(','), #%w[RICE CROP],
ontology_name: Array(params[:name]) + Array(params[:name]&.capitalize),
isOfType: params[:isOfType]&.split(','), #["http://omv.ontoware.org/2005/05/ontology#Vocabulary"],
viewingRestriction: params[:viewingRestriction]&.split(','), #["private"]
}
inverse_filters = {
status: params[:status], #"retired",
submissionStatus: params[:submissionStatus] #"RDF",
}

filters.each do |key , values|
attr = extract_attr(key)
next if Array(values).empty?

filter = Goo::Filter.new(attr).regex(values.first)
values.drop(1).each do |v|
filter = filter.or(Goo::Filter.new(attr).regex(v))
end
query = query.filter(filter)
end

inverse_filters.each do |key ,value|
attr = extract_attr(key)
next unless value

filter = Goo::Filter.new(attr).regex("^(?:(?!#{value}).)*$")
query = query.filter(filter)
end
query
end

def extract_attr(key)
attr, sub_attr, sub_sub_attr = key.to_s.split('_')

return attr.to_sym unless sub_attr

return {attr.to_sym => [sub_attr.to_sym]} unless sub_sub_attr

{attr.to_sym => [sub_attr.to_sym => sub_sub_attr.to_sym]}
end

def get_order_by_from(params, default_order = :asc)
if is_set?(params['sortby'])
orders = (params["order"] || default_order.to_s).split(',')
51 changes: 51 additions & 0 deletions helpers/submission_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
require 'sinatra/base'

module Sinatra
module Helpers
module SubmissionHelper

def retrieve_submissions(options)
status = (options[:status] || "RDF").to_s.upcase
status = "RDF" if status.eql?("READY")
any = status.eql?("ANY")
include_views = options[:also_include_views] || false
includes, page, size, order_by, _ = settings_params(LinkedData::Models::OntologySubmission)
includes << :submissionStatus unless includes.include?(:submissionStatus)


submissions_query = LinkedData::Models::OntologySubmission
if any
submissions_query = submissions_query.where
else
submissions_query = submissions_query.where({submissionStatus: [ code: status]})
end

submissions_query = apply_filters(submissions_query)
submissions_query = submissions_query.filter(Goo::Filter.new(ontology: [:viewOf]).unbound) unless include_views
submissions_query = submissions_query.filter(filter) if filter?

# When asking to display all metadata, we are using bring_remaining on each submission. Slower but best way to retrieve all attrs
if includes_param.first == :all
includes = [:submissionId, {:contact=>[:name, :email], :ontology=>[:administeredBy, :acronym, :name, :summaryOnly, :ontologyType, :viewingRestriction, :acl,
:group, :hasDomain, :views, :viewOf, :flat], :submissionStatus=>[:code], :hasOntologyLanguage=>[:acronym]}, :submissionStatus]
elsif includes.find{|v| v.is_a?(Hash) && v.keys.first.eql?(:ontology)}
includes << {:ontology=>[:administeredBy, :acronym, :name, :viewingRestriction, :group, :hasDomain]}
end

submissions = submissions_query.include(includes)
if page?
submissions.page(page, size).all
else
submissions.to_a
end
end

def include_ready?(options)
options[:status] && options[:status].to_s.upcase.eql?("READY")
end

end
end
end

helpers Sinatra::Helpers::SubmissionHelper
15 changes: 15 additions & 0 deletions test/controllers/test_ontology_submissions_controller.rb
Original file line number Diff line number Diff line change
@@ -195,4 +195,19 @@ def test_download_acl_only
end
end

def test_submissions_pagination
num_onts_created, created_ont_acronyms = create_ontologies_and_submissions(ont_count: 2, submission_count: 2)

get "/submissions"
assert last_response.ok?
submissions = MultiJson.load(last_response.body)

assert_equal 2, submissions.length


get "/submissions?page=1&pagesize=1"
assert last_response.ok?
submissions = MultiJson.load(last_response.body)
assert_equal 1, submissions["collection"].length
end
end