[ARVADOS] updated: 8f8a99ce94818a5dbe372d8704ab396bff897489
git at public.curoverse.com
git at public.curoverse.com
Mon Nov 24 12:22:33 EST 2014
Summary of changes:
services/api/test/integration/remote_reset_test.rb | 38 ++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 services/api/test/integration/remote_reset_test.rb
via 8f8a99ce94818a5dbe372d8704ab396bff897489 (commit)
from 75634adbcd7caebd58fad84f74feb5e1152a1254 (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 8f8a99ce94818a5dbe372d8704ab396bff897489
Author: Tom Clegg <tom at curoverse.com>
Date: Mon Nov 24 12:20:53 2014 -0500
4533: Add integration test.
diff --git a/services/api/test/integration/remote_reset_test.rb b/services/api/test/integration/remote_reset_test.rb
new file mode 100644
index 0000000..81f341a
--- /dev/null
+++ b/services/api/test/integration/remote_reset_test.rb
@@ -0,0 +1,38 @@
+require 'test_helper'
+
+class RemoteResetTest < ActionDispatch::IntegrationTest
+ self.use_transactional_fixtures = false
+
+ test "roll back database change" do
+ active_auth = auth(:active)
+ admin_auth = auth(:admin)
+
+ old_uuid = specimens(:owned_by_active_user).uuid
+ new_uuid = nil
+ authorize_with :admin
+ post '/database/reset', {}, admin_auth
+ assert_response :success
+
+ delete '/arvados/v1/specimens/' + old_uuid, {}, active_auth
+ assert_response :success
+ post '/arvados/v1/specimens', {specimen: '{}'}, active_auth
+ assert_response :success
+
+ new_uuid = json_response['uuid']
+ get '/arvados/v1/specimens/'+new_uuid, {}, active_auth
+ assert_response :success
+ get '/arvados/v1/specimens/'+old_uuid, {}, active_auth
+ assert_response 404
+
+ # Reset to fixtures.
+ post '/database/reset', {}, admin_auth
+ assert_response :success
+
+ # New speciment should disappear. Old specimen should reappear.
+ get '/arvados/v1/specimens/'+new_uuid, {}, active_auth
+ assert_response 404
+ get '/arvados/v1/specimens/'+old_uuid, {}, active_auth
+ assert_response :success
+ assert_empty Specimen.where(uuid: new_uuid)
+ end
+end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list