Merge branch '3187-pipeline-instance-page' into 3605-improved-dashboard
authorPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 19 Sep 2014 19:40:53 +0000 (15:40 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 19 Sep 2014 19:40:53 +0000 (15:40 -0400)
Conflicts:
apps/workbench/app/models/job.rb

1  2 
apps/workbench/app/models/job.rb
apps/workbench/test/integration/projects_test.rb

index 1006660696d000f7ed8f85cfc63cc09148fe36e8,1deb13ab538d3537be3fcf3e63d5cdeb4f4bc673..a0247ef10448284ce1b6bea0573f1ac77c8fd994
@@@ -38,17 -38,13 +38,17 @@@ class Job < ArvadosBas
      arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
    end
  
-   def state
-     Job::state(self)
-   end
 +  def self.queue_size
 +    arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
 +  end
 +
    def self.state job
+     if job.respond_to? :state and job.state
+       return job.state
+     end
      if not job[:cancelled_at].nil?
-       "Canceled"
+       "Cancelled"
      elsif not job[:finished_at].nil? or not job[:success].nil?
        if job[:success]
          "Completed"
index 7c5f9a6294bb999ebcb86c357efceb7fe51e8cff,c0443cc46c6bb21360ec25b12f1e25066e4a09ce..2a363c57bec85a47bc220df247e1a17d6373378c
@@@ -7,10 -7,17 +7,17 @@@ class ProjectsTest < ActionDispatch::In
      Capybara.current_driver = Capybara.javascript_driver
    end
  
+   test 'Check collection count for A Project in the tab pane titles' do
+     project_uuid = api_fixture('groups')['aproject']['uuid']
+     visit page_with_token 'active', '/projects/' + project_uuid
+     collection_count = page.all("[data-pk*='collection']").count
+     assert_selector '#Data_collections-tab span', text: "(#{collection_count})"
+   end
    test 'Find a project and edit its description' do
      visit page_with_token 'active', '/'
 -    find('.arv-project-list a,button', text: 'A Project').
 -      click
 +    find("#projects-menu").click
 +    find(".dropdown-menu a", text: "A Project").click
      within('.container-fluid', text: api_fixture('groups')['aproject']['name']) do
        find('span', text: api_fixture('groups')['aproject']['name']).click
        within('.arv-description-as-subtitle') do