11185: Removed newly added completed-acr fixture and modified the already existing...
authorLucas Di Pentima <lucas@curoverse.com>
Mon, 1 May 2017 19:58:48 +0000 (16:58 -0300)
committerLucas Di Pentima <lucas@curoverse.com>
Mon, 1 May 2017 19:58:48 +0000 (16:58 -0300)
to be able to use it on the tests.
Change the reset_form() JS function to something more specific to this usage, to avoid future
conflicts.

apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
apps/workbench/test/controllers/container_requests_controller_test.rb
services/api/test/fixtures/container_requests.yml

index 9cf03c8b597d13d07caa1a2d5a77d85022f07757..049be759beed84778bf4bf35bb474f3e83e7a0cd 100644 (file)
@@ -1,16 +1,16 @@
 <% if @object.state == 'Final' %>
+<script type="application/javascript">
+  function reset_form_cr_reuse() {
+    $('#use_existing').removeAttr('checked');
+  }
+</script>
+
   <%= link_to raw('<i class="fa fa-fw fa-play"></i> Re-run...'),
       "#",
       {class: 'btn btn-sm btn-primary', 'data-toggle' => 'modal',
        'data-target' => '#clone-and-edit-modal-window',
        title: 'This will make a copy and take you there. You can then make any needed changes and run it'}  %>
 
-<script type="application/javascript">
-  function reset_form() {
-    $('#use_existing').removeAttr('checked');
-  }
-</script>
-
 <div id="clone-and-edit-modal-window" class="modal fade" role="dialog"
      aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
@@ -19,7 +19,7 @@
     <%= form_tag copy_container_request_path do |f| %>
 
       <div class="modal-header">
-        <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
+        <button type="button" class="close" onClick="reset_form_cr_reuse()" data-dismiss="modal" aria-hidden="true">&times;</button>
         <div>
           <div class="col-sm-6"> <h4 class="modal-title">Re-run container request</h4> </div>
         </div>
@@ -32,7 +32,7 @@
       </div>
 
       <div class="modal-footer">
-        <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
+        <button class="btn btn-default" onClick="reset_form_cr_reuse()" data-dismiss="modal" aria-hidden="true">Cancel</button>
         <button type="submit" class="btn btn-primary" name="container_request[state]" value="Uncommitted">Copy and edit inputs</button>
       </div>
 
index 804263cd49d3ca234cd1244691c030881baa88ea..01f740cfa063f60686140900803acd3e8cd3253a 100644 (file)
@@ -44,11 +44,12 @@ class ContainerRequestsControllerTest < ActionController::TestCase
   [
     ['completed', false, false],
     ['completed', true, false],
-    ['completed-acr', false, true],
-    ['completed-acr', true, true],
+    ['completed-older', false, true],
+    ['completed-older', true, true],
   ].each do |cr_fixture, reuse_enabled, uses_acr|
     test "container request #{uses_acr ? '' : 'not'} using arvados-cwl-runner copy #{reuse_enabled ? 'with' : 'without'} reuse enabled" do
       completed_cr = api_fixture('container_requests')[cr_fixture]
+      # Set up post request params
       copy_params = {id: completed_cr['uuid']}
       if reuse_enabled
         copy_params.merge!({use_existing: true})
index b35829aacc9182dcbcafbc19a90c7fa56d2129b8..d5bb47f6ff30e1bcae98944a47844b01f4d98c99 100644 (file)
@@ -109,25 +109,6 @@ completed-older:
   container_image: test
   cwd: test
   output_path: test
-  command: ["echo", "hello"]
-  container_uuid: zzzzz-dz642-compltcontainr2
-  runtime_constraints:
-    vcpus: 1
-    ram: 123
-
-completed-acr:
-  uuid: zzzzz-xvhdp-cr4completedacr
-  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
-  name: completed
-  state: Final
-  priority: 1
-  created_at: 2016-01-11 11:11:11.111111111 Z
-  updated_at: 2016-01-11 11:11:11.111111111 Z
-  modified_at: 2016-01-11 11:11:11.111111111 Z
-  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
-  container_image: test
-  cwd: test
-  output_path: test
   command: ["arvados-cwl-runner", "echo", "hello"]
   container_uuid: zzzzz-dz642-compltcontainr2
   runtime_constraints: