[ARVADOS] updated: 92cb77cd08bbcc8ca0c0eab3aa5446efd43fb69f

git at public.curoverse.com git at public.curoverse.com
Mon Jun 2 11:04:12 EDT 2014


Summary of changes:
 apps/workbench/app/models/api_client_authorization.rb               | 2 +-
 apps/workbench/app/models/authorized_key.rb                         | 4 ++--
 apps/workbench/app/models/collection.rb                             | 2 +-
 apps/workbench/app/models/job.rb                                    | 2 +-
 apps/workbench/app/models/user.rb                                   | 4 ++--
 apps/workbench/app/models/virtual_machine.rb                        | 4 ++--
 apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb | 6 +++++-
 apps/workbench/test/integration/collections_test.rb                 | 2 +-
 apps/workbench/test/integration/folders_test.rb                     | 2 +-
 apps/workbench/test/integration/pipeline_instances_test.rb          | 2 +-
 apps/workbench/test/integration/users_test.rb                       | 4 ++++
 apps/workbench/test/integration/virtual_machines_test.rb            | 1 +
 12 files changed, 22 insertions(+), 13 deletions(-)

       via  92cb77cd08bbcc8ca0c0eab3aa5446efd43fb69f (commit)
      from  885a37384af5c3252f81518e6bcedc2abf50489b (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 92cb77cd08bbcc8ca0c0eab3aa5446efd43fb69f
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jun 2 11:03:50 2014 -0400

    2872: Fix some tests and bugs

diff --git a/apps/workbench/app/models/api_client_authorization.rb b/apps/workbench/app/models/api_client_authorization.rb
index 620ebc7..ac3a9bf 100644
--- a/apps/workbench/app/models/api_client_authorization.rb
+++ b/apps/workbench/app/models/api_client_authorization.rb
@@ -1,5 +1,5 @@
 class ApiClientAuthorization < ArvadosBase
-  def attribute_editable?(attr)
+  def attribute_editable? attr, *args
     ['expires_at', 'default_owner_uuid'].index attr
   end
   def self.creatable?
diff --git a/apps/workbench/app/models/authorized_key.rb b/apps/workbench/app/models/authorized_key.rb
index c018cc5..8f4d62c 100644
--- a/apps/workbench/app/models/authorized_key.rb
+++ b/apps/workbench/app/models/authorized_key.rb
@@ -1,9 +1,9 @@
 class AuthorizedKey < ArvadosBase
-  def attribute_editable?(attr)
+  def attribute_editable? attr, *args
     if attr.to_s == 'authorized_user_uuid'
       current_user and current_user.is_admin
     else
-      super(attr)
+      super attr, *args
     end
   end
 end
diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb
index ae86108..4f4a790 100644
--- a/apps/workbench/app/models/collection.rb
+++ b/apps/workbench/app/models/collection.rb
@@ -46,7 +46,7 @@ class Collection < ArvadosBase
     dir_to_tree.call('.')
   end
 
-  def attribute_editable?(attr)
+  def attribute_editable? attr, *args
     false
   end
 
diff --git a/apps/workbench/app/models/job.rb b/apps/workbench/app/models/job.rb
index 6fe3743..9863697 100644
--- a/apps/workbench/app/models/job.rb
+++ b/apps/workbench/app/models/job.rb
@@ -3,7 +3,7 @@ class Job < ArvadosBase
     true
   end
 
-  def attribute_editable?(attr)
+  def attribute_editable? attr, *args
     false
   end
 
diff --git a/apps/workbench/app/models/user.rb b/apps/workbench/app/models/user.rb
index c1656bd..b4009c2 100644
--- a/apps/workbench/app/models/user.rb
+++ b/apps/workbench/app/models/user.rb
@@ -31,8 +31,8 @@ class User < ArvadosBase
     super.reject { |k,v| %w(owner_uuid default_owner_uuid identity_url prefs).index k }
   end
 
- def attribute_editable?(attr)
-    (not (self.uuid.andand.match(/000000000000000$/) and self.is_admin)) and super(attr)
+ def attribute_editable? attr, *args
+    (not (self.uuid.andand.match(/000000000000000$/) and self.is_admin)) and super(attr, *args)
   end
 
   def friendly_link_name
diff --git a/apps/workbench/app/models/virtual_machine.rb b/apps/workbench/app/models/virtual_machine.rb
index 5ff7798..705ab8c 100644
--- a/apps/workbench/app/models/virtual_machine.rb
+++ b/apps/workbench/app/models/virtual_machine.rb
@@ -6,8 +6,8 @@ class VirtualMachine < ArvadosBase
   def attributes_for_display
     super.append ['current_user_logins', @current_user_logins]
   end
-  def attribute_editable?(attr)
-    attr != 'current_user_logins' and super
+  def attribute_editable? attr, *args
+    attr != 'current_user_logins' and super *args
   end
   def self.attribute_info
     merger = ->(k,a,b) { a.merge(b, &merger) }
diff --git a/apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb b/apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb
index fb688b4..44f4f95 100644
--- a/apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb
+++ b/apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb
@@ -4,7 +4,11 @@
     <div class="row">
       <div class="col-sm-4">
         <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
-        <%= render_editable_attribute object, 'name', nil %>
+        <% if object.respond_to?(:name) %>
+          <%= render_editable_attribute object, 'name', nil %>
+        <% else %>
+          <%= object.class_for_display %> <%= object.uuid %>
+        <% end %>
       </div>
       <div class="col-sm-8 arv-description-in-table">
         <%= render_controller_partial(
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index 911daa0..562e2d3 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -13,7 +13,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     page.assert_no_selector "div[data-persistent-state='#{oldstate}']"
   end
 
-  ['/collections', '/'].each do |path|
+  ['/collections', '/users/welcome'].each do |path|
     test "Flip persistent switch at #{path}" do
       Capybara.current_driver = Capybara.javascript_driver
       uuid = api_fixture('collections')['foo_file']['uuid']
diff --git a/apps/workbench/test/integration/folders_test.rb b/apps/workbench/test/integration/folders_test.rb
index 7518d3c..fc7cd1d 100644
--- a/apps/workbench/test/integration/folders_test.rb
+++ b/apps/workbench/test/integration/folders_test.rb
@@ -29,7 +29,7 @@ class FoldersTest < ActionDispatch::IntegrationTest
     folder_uuid = api_fixture('groups')['afolder']['uuid']
     specimen_uuid = api_fixture('specimens')['owned_by_afolder_with_no_name_link']['uuid']
     visit page_with_token 'active', '/folders/' + folder_uuid
-    within('.panel tr', text: specimen_uuid) do
+    within(".panel tr[data-object-uuid='#{specimen_uuid}']") do
       find(".editable[data-name='name']").click
       find('.editable-input input').set('Now I have a name.')
       find('.glyphicon-ok').click
diff --git a/apps/workbench/test/integration/pipeline_instances_test.rb b/apps/workbench/test/integration/pipeline_instances_test.rb
index e3449f6..50d328a 100644
--- a/apps/workbench/test/integration/pipeline_instances_test.rb
+++ b/apps/workbench/test/integration/pipeline_instances_test.rb
@@ -13,7 +13,7 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
   test 'Create and run a pipeline' do
     visit page_with_token('active_trustedclient')
 
-    click_link 'Pipeline templates'
+    visit '/pipeline_templates'
     within('tr', text: 'Two Part Pipeline Template') do
       find('a,button', text: 'Run').click
     end
diff --git a/apps/workbench/test/integration/users_test.rb b/apps/workbench/test/integration/users_test.rb
index 7651563..7be12d7 100644
--- a/apps/workbench/test/integration/users_test.rb
+++ b/apps/workbench/test/integration/users_test.rb
@@ -16,6 +16,7 @@ class UsersTest < ActionDispatch::IntegrationTest
     visit page_with_token('admin_trustedclient')
 
     # go to Users list page
+    find('#system-menu').click
     click_link 'Users'
 
     # check active user attributes in the list page
@@ -50,6 +51,7 @@ class UsersTest < ActionDispatch::IntegrationTest
 
     visit page_with_token('admin_trustedclient')
 
+    find('#system-menu').click
     click_link 'Users'
 
     assert page.has_text? 'zzzzz-tpzed-d9tiejq69daie8f'
@@ -100,6 +102,7 @@ class UsersTest < ActionDispatch::IntegrationTest
     Capybara.current_driver = :selenium
     visit page_with_token('admin_trustedclient')
 
+    find('#system-menu').click
     click_link 'Users'
 
     # click on active user
@@ -159,6 +162,7 @@ class UsersTest < ActionDispatch::IntegrationTest
 
     visit page_with_token('admin_trustedclient')
 
+    find('#system-menu').click
     click_link 'Users'
 
     # click on active user
diff --git a/apps/workbench/test/integration/virtual_machines_test.rb b/apps/workbench/test/integration/virtual_machines_test.rb
index 26da0d0..7a40d0d 100644
--- a/apps/workbench/test/integration/virtual_machines_test.rb
+++ b/apps/workbench/test/integration/virtual_machines_test.rb
@@ -4,6 +4,7 @@ class VirtualMachinesTest < ActionDispatch::IntegrationTest
   test "make and name a new virtual machine" do
     Capybara.current_driver = Capybara.javascript_driver
     visit page_with_token('admin_trustedclient')
+    find('#system-menu').click
     click_link 'Virtual machines'
     assert page.has_text? 'testvm.shell'
     click_on 'Add a new virtual machine'

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list