[ARVADOS] updated: 95323ba327cadff2d1cb8c3f38c5dbb65dbd3694

git at public.curoverse.com git at public.curoverse.com
Thu Nov 13 17:27:58 EST 2014


Summary of changes:
 .../controllers/pipeline_instances_controller.rb   |  7 ------
 .../app/views/pipeline_instances/index.html.erb    |  5 +++-
 .../integration/filterable_infinite_scroll_test.rb | 27 ++++++++++++++++++++++
 3 files changed, 31 insertions(+), 8 deletions(-)
 create mode 100644 apps/workbench/test/integration/filterable_infinite_scroll_test.rb

       via  95323ba327cadff2d1cb8c3f38c5dbb65dbd3694 (commit)
       via  eb185aab22bd916981ea874fd82e6a1fecce7cd2 (commit)
      from  bc4992f9e11cd0639cf6461736963d66830c5af8 (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 95323ba327cadff2d1cb8c3f38c5dbb65dbd3694
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Nov 13 17:27:51 2014 -0500

    4024: Add test for double-load bug.

diff --git a/apps/workbench/app/views/pipeline_instances/index.html.erb b/apps/workbench/app/views/pipeline_instances/index.html.erb
index 2308fc1..e538815 100644
--- a/apps/workbench/app/views/pipeline_instances/index.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/index.html.erb
@@ -2,7 +2,10 @@
   <div class="input-group">
     <input type="text" class="form-control filterable-control recent-pipeline-instances-filterable-control"
            placeholder="Search pipeline instances"
-           data-filterable-target="#recent-pipeline-instances"/>
+           data-filterable-target="#recent-pipeline-instances"
+           <%# Just for the double-load test in FilterableInfiniteScrollTest: %>
+           value="<%= params[:search] %>"
+           />
   </div>
 
   <%= form_tag({action: 'compare', controller: params[:controller], method: 'get'}, {method: 'get', id: 'compare', class: 'pull-right small-form-margin'}) do |f| %>
diff --git a/apps/workbench/test/integration/filterable_infinite_scroll_test.rb b/apps/workbench/test/integration/filterable_infinite_scroll_test.rb
new file mode 100644
index 0000000..14a0677
--- /dev/null
+++ b/apps/workbench/test/integration/filterable_infinite_scroll_test.rb
@@ -0,0 +1,27 @@
+require 'integration_helper'
+
+class FilterableInfiniteScrollTest < ActionDispatch::IntegrationTest
+  setup do
+    Capybara.current_driver = :selenium
+  end
+
+  # Chrome remembers what you had in the text field when you hit
+  # "back". Here, we simulate the same effect by sending an otherwise
+  # unused ?search=foo param to pre-populate the search field.
+  test 'no double-load if text input has a value at page load time' do
+    visit page_with_token('admin', '/pipeline_instances')
+    assert_text 'pipeline_2'
+    visit page_with_token('admin', '/pipeline_instances?search=pipeline_1')
+    # Horrible hack to ensure the search results can't load correctly
+    # on the second attempt.
+    assert_selector '#recent-pipeline-instances'
+    assert page.evaluate_script('$("#recent-pipeline-instances[data-infinite-content-href0]").attr("data-infinite-content-href0","/give-me-an-error").length == 1')
+    # Wait for the first page of results to appear.
+    assert_text 'pipeline_1'
+    # Make sure the results are filtered.
+    assert_no_text 'pipeline_2'
+    # Make sure pipeline_2 didn't disappear merely because the results
+    # were replaced with an error message.
+    assert_text 'pipeline_1'
+  end
+end

commit eb185aab22bd916981ea874fd82e6a1fecce7cd2
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Nov 13 16:21:44 2014 -0500

    4024: Remove unused /pipeline_instances/?search=x support.

diff --git a/apps/workbench/app/controllers/pipeline_instances_controller.rb b/apps/workbench/app/controllers/pipeline_instances_controller.rb
index f5522ce..fa724b8 100644
--- a/apps/workbench/app/controllers/pipeline_instances_controller.rb
+++ b/apps/workbench/app/controllers/pipeline_instances_controller.rb
@@ -287,13 +287,6 @@ class PipelineInstancesController < ApplicationController
   end
 
   def index
-    if params[:search].andand.length.andand > 0
-      @select ||= PipelineInstance.columns.map(&:name)
-      base_search = PipelineInstance.select(@select)
-      @objects = base_search.where(any: ['contains', params[:search]]).
-                              uniq { |pi| pi.uuid }
-    end
-
     @limit = 20
     super
   end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list