[ARVADOS] updated: a88b81005608f38bb269693d961f29bad5a9eb35
git at public.curoverse.com
git at public.curoverse.com
Tue Oct 27 15:47:08 EDT 2015
Summary of changes:
apps/workbench/app/models/keep_disk.rb | 2 +-
apps/workbench/app/models/keep_service.rb | 2 +-
apps/workbench/app/models/virtual_machine.rb | 2 +-
apps/workbench/test/integration/application_layout_test.rb | 6 +++---
apps/workbench/test/integration/virtual_machines_test.rb | 14 ++++++++++++++
5 files changed, 20 insertions(+), 6 deletions(-)
via a88b81005608f38bb269693d961f29bad5a9eb35 (commit)
from 9290961beb18476f71aa0ae12478fe50493e8ad9 (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 a88b81005608f38bb269693d961f29bad5a9eb35
Author: radhika <radhika at curoverse.com>
Date: Tue Oct 27 15:46:33 2015 -0400
7453: Upon Nico's request, put back the "Add a new" button in keep disks, keep services, and virtual machines pages.
diff --git a/apps/workbench/app/models/keep_disk.rb b/apps/workbench/app/models/keep_disk.rb
index 6438fc7..8ced4eb 100644
--- a/apps/workbench/app/models/keep_disk.rb
+++ b/apps/workbench/app/models/keep_disk.rb
@@ -1,5 +1,5 @@
class KeepDisk < ArvadosBase
def self.creatable?
- false
+ current_user and current_user.is_admin
end
end
diff --git a/apps/workbench/app/models/keep_service.rb b/apps/workbench/app/models/keep_service.rb
index 0c998c4..f27e369 100644
--- a/apps/workbench/app/models/keep_service.rb
+++ b/apps/workbench/app/models/keep_service.rb
@@ -1,5 +1,5 @@
class KeepService < ArvadosBase
def self.creatable?
- false
+ current_user and current_user.is_admin
end
end
diff --git a/apps/workbench/app/models/virtual_machine.rb b/apps/workbench/app/models/virtual_machine.rb
index e1a208c..3a86a35 100644
--- a/apps/workbench/app/models/virtual_machine.rb
+++ b/apps/workbench/app/models/virtual_machine.rb
@@ -2,7 +2,7 @@ class VirtualMachine < ArvadosBase
attr_accessor :current_user_logins
def self.creatable?
- false
+ current_user and current_user.is_admin
end
def attributes_for_display
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index db072e4..462667c 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -219,13 +219,13 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
[
['Repositories', nil, 's0uqq'],
- ['Virtual machines', nil, 'testvm.shell'],
+ ['Virtual machines', 'virtual machine', 'current_user_logins'],
['SSH keys', nil, 'public_key'],
['Links', nil, 'link_class'],
['Groups', nil, 'All users'],
['Compute nodes', nil, 'ping_secret'],
- ['Keep services', nil, 'service_ssl_flag'],
- ['Keep disks', nil, 'bytes_free'],
+ ['Keep services', 'keep service', 'service_ssl_flag'],
+ ['Keep disks', 'keep disk', 'bytes_free'],
].each do |page_name, add_button_text, look_for|
test "test system menu #{page_name} link" do
visit page_with_token('admin')
diff --git a/apps/workbench/test/integration/virtual_machines_test.rb b/apps/workbench/test/integration/virtual_machines_test.rb
index a22337b..1d398a5 100644
--- a/apps/workbench/test/integration/virtual_machines_test.rb
+++ b/apps/workbench/test/integration/virtual_machines_test.rb
@@ -1,4 +1,18 @@
require 'integration_helper'
class VirtualMachinesTest < ActionDispatch::IntegrationTest
+ test "make and name a new virtual machine" do
+ need_javascript
+ 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'
+ find('tr', text: 'hostname').
+ find('a[data-original-title=edit]').click
+ assert page.has_text? 'Edit hostname'
+ fill_in 'editable-text', with: 'testname'
+ click_button 'editable-submit'
+ assert page.has_text? 'testname'
+ end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list