[ARVADOS] updated: 857eb4ccd458f67f9cb49215490a5c8ebb1597c0
git at public.curoverse.com
git at public.curoverse.com
Fri Mar 28 15:22:06 EDT 2014
Summary of changes:
apps/workbench/test/integration/users_test.rb | 103 +++++++++++++++++++++++++
1 files changed, 103 insertions(+), 0 deletions(-)
create mode 100644 apps/workbench/test/integration/users_test.rb
via 857eb4ccd458f67f9cb49215490a5c8ebb1597c0 (commit)
from 3262e46dd0fff9d6289f8d91207a585df9de7074 (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 857eb4ccd458f67f9cb49215490a5c8ebb1597c0
Author: radhika chippada <radhika at radhika.curoverse>
Date: Fri Mar 28 15:21:05 2014 -0400
Add users integration test class. Beginnings of setup and unsetup method tests.
diff --git a/apps/workbench/test/integration/users_test.rb b/apps/workbench/test/integration/users_test.rb
new file mode 100644
index 0000000..5c4848e
--- /dev/null
+++ b/apps/workbench/test/integration/users_test.rb
@@ -0,0 +1,103 @@
+require 'integration_helper'
+
+class UsersTest < ActionDispatch::IntegrationTest
+
+ test "create a new user" do
+ Capybara.current_driver = Capybara.javascript_driver
+ visit page_with_token('admin_trustedclient')
+
+ click_link 'Users'
+
+ assert page.has_text? 'zzzzz-tpzed-d9tiejq69daie8f'
+
+ click_on 'Add a new user'
+
+ # for now just check that we are back in Users -> List page
+ assert page.has_text? 'zzzzz-tpzed-d9tiejq69daie8f'
+ end
+
+ test "unsetup active user" do
+ Capybara.current_driver = Capybara.javascript_driver
+ visit page_with_token('admin_trustedclient')
+
+ click_link 'Users'
+
+ assert page.has_link? 'zzzzz-tpzed-xurymjxw79nv3jz'
+
+ # click on active user
+ click_link 'zzzzz-tpzed-xurymjxw79nv3jz'
+ assert page.has_text? 'Attributes'
+ assert page.has_text? 'Metadata'
+ assert page.has_text? 'Admin'
+
+ # go to the Attributes tab
+ click_link 'Attributes'
+ assert page.has_text? 'modified_by_user_uuid'
+ page.within(:xpath, '//a[@data-name="is_active"]') do
+ assert_equal text, "true", "Expected user's is_active to be true"
+ end
+
+ # go to Admin tab
+ click_link 'Admin'
+ assert page.has_text? 'As an admin, you can deactivate and reset this user'
+
+ # Click on Deactivate button
+ click_button 'Deactivate Active User'
+
+ # Click Ok in the confirm dialog
+ sleep(0.1)
+
+ popup = page.driver.window_handles.last
+ page.within_window popup do
+ assert has_text? 'Are you sure you want to deactivate Active User'
+ click_button "Ok"
+ end
+
+ # Should now be back in the Attributes tab for the user
+ assert page.has_text? 'modified_by_user_uuid'
+ page.within(:xpath, '//a[@data-name="is_active"]') do
+ assert_equal text, "false", "Expected user's is_active to be false after unsetup"
+ end
+
+ end
+
+ test "setup the active user" do
+ Capybara.current_driver = Capybara.javascript_driver
+ visit page_with_token('admin_trustedclient')
+
+ click_link 'Users'
+
+ assert page.has_link? 'zzzzz-tpzed-xurymjxw79nv3jz'
+
+ # click on active user
+ click_link 'zzzzz-tpzed-xurymjxw79nv3jz'
+ assert page.has_text? 'Attributes'
+ assert page.has_text? 'Metadata'
+ assert page.has_text? 'Admin'
+
+ # go to Admin tab
+ click_link 'Admin'
+ assert page.has_text? 'As an admin, you can deactivate and reset this user'
+
+=begin
+ # Click on Setup button
+ click_button 'Setup Active User'
+
+ # Click Ok in the confirm dialog
+ sleep(0.1)
+
+ popup = page.driver.window_handles.last
+ page.within_window popup do
+ assert has_text? 'Are you sure you want to deactivate Active User'
+ fill_in "email", :with => "test at example.com"
+ click_button "Ok"
+ end
+
+ # Should now be back in the Attributes tab for the user
+ assert page.has_text? 'modified_by_client_uuid'
+
+ puts "\n\n************* page now = \n#{page.body}"
+=end
+ end
+
+end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list