[ARVADOS] updated: 0a5f8b68dbc86519f1faa10d1597c47776bb80dd
git at public.curoverse.com
git at public.curoverse.com
Wed Sep 17 10:21:48 EDT 2014
Summary of changes:
services/api/lib/tasks/config_check.rake | 4 ++--
.../arvados/v1/collections_controller_test.rb | 21 +++++++++++++++++----
2 files changed, 19 insertions(+), 6 deletions(-)
via 0a5f8b68dbc86519f1faa10d1597c47776bb80dd (commit)
from 9d1876405f50e009b686bce51c2469a52d2f79ca (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 0a5f8b68dbc86519f1faa10d1597c47776bb80dd
Author: Tim Pierce <twp at curoverse.com>
Date: Wed Sep 17 10:20:48 2014 -0400
3411: code review feedback
* Ensure each functional test issues only one request to the controller
* $application_config['default_trash_lifetime'] -> Rails.configuration.default_trash_lifetime
diff --git a/services/api/lib/tasks/config_check.rake b/services/api/lib/tasks/config_check.rake
index c421101..1b38655 100644
--- a/services/api/lib/tasks/config_check.rake
+++ b/services/api/lib/tasks/config_check.rake
@@ -16,8 +16,8 @@ namespace :config do
end
end
# default_trash_lifetime cannot be less than 24 hours
- if $application_config['default_trash_lifetime'] < 86400 then
- raise "default_trash_lifetime is %d, must be at least 86400" % $application_config['default_trash_lifetime']
+ if Rails.configuration.default_trash_lifetime < 86400 then
+ raise "default_trash_lifetime is %d, must be at least 86400" % Rails.configuration.default_trash_lifetime
end
end
end
diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index 81e77cd..f2c15c6 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -559,7 +559,7 @@ EOS
"Collection should not exist in database after failed create"
end
- test 'Expired collections are not returned' do
+ test 'List expired collection returns empty list' do
authorize_with :active
get :index, {
where: {name: 'expired_collection'},
@@ -567,12 +567,18 @@ EOS
assert_response :success
found = assigns(:objects)
assert_equal 0, found.count
+ end
+ test 'Show expired collection returns 404' do
+ authorize_with :active
get :show, {
id: 'zzzzz-4zz18-mto52zx1s7sn3ih',
}
assert_response 404
+ end
+ test 'Update expired collection returns 404' do
+ authorize_with :active
post :update, {
id: 'zzzzz-4zz18-mto52zx1s7sn3ih',
collection: {
@@ -582,25 +588,32 @@ EOS
assert_response 404
end
- test 'Collection with future expiration time is returned' do
+ test 'List collection with future expiration time succeeds' do
authorize_with :active
get :index, {
where: {name: 'collection_expires_in_future'},
}
found = assigns(:objects)
assert_equal 1, found.count
+ end
+
+ test 'Show collection with future expiration time succeeds' do
+ authorize_with :active
get :show, {
id: 'zzzzz-4zz18-padkqo7yb8d9i3j',
}
- assert_success
+ assert_response :success
+ end
+ test 'Update collection with future expiration time succeeds' do
+ authorize_with :active
post :update, {
id: 'zzzzz-4zz18-padkqo7yb8d9i3j',
collection: {
name: "still not expired"
}
}
- assert_success
+ assert_response :success
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list