From: radhika Date: Thu, 22 Jun 2017 19:40:40 +0000 (-0400) Subject: 11840: include ensure_unique_name parameter in untrash requests from workbench. X-Git-Tag: 1.1.0~173^2~1 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/7415bc3f7239b5c062e3876681265912d8150edd 11840: include ensure_unique_name parameter in untrash requests from workbench. Arvados-DCO-1.1-Signed-off-by: Radhika Chippada --- diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb index 305ea01530..025c136d41 100644 --- a/apps/workbench/app/models/collection.rb +++ b/apps/workbench/app/models/collection.rb @@ -99,6 +99,6 @@ class Collection < ArvadosBase end def untrash - arvados_api_client.api(self.class, "/#{self.uuid}/untrash", {}) + arvados_api_client.api(self.class, "/#{self.uuid}/untrash", {"ensure_unique_name" => true}) end end diff --git a/apps/workbench/test/controllers/trash_items_controller_test.rb b/apps/workbench/test/controllers/trash_items_controller_test.rb new file mode 100644 index 0000000000..c530ba9f6d --- /dev/null +++ b/apps/workbench/test/controllers/trash_items_controller_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class TrashItemsControllerTest < ActionController::TestCase + test "untrash collection with same name as another collection" do + collection = api_fixture('collections')['trashed_collection_to_test_name_conflict_on_untrash'] + items = [collection['uuid']] + post :untrash_items, { + selection: items, + format: :js + }, session_for(:active) + + assert_response :success + end +end