[ARVADOS] updated: 663d024598ea7b6384b9e24e5ea760ecb710ecda
git at public.curoverse.com
git at public.curoverse.com
Fri Mar 27 13:53:23 EDT 2015
Summary of changes:
.../application/_getting_started_popup.html.erb | 2 +-
apps/workbench/app/views/layouts/body.html.erb | 4 +++-
apps/workbench/app/views/users/profile.html.erb | 2 +-
.../test/integration/user_profile_test.rb | 27 ++++++++++++++++++----
.../test/fixtures/api_client_authorizations.yml | 10 ++++++--
services/api/test/fixtures/users.yml | 14 ++++++++++-
6 files changed, 48 insertions(+), 11 deletions(-)
via 663d024598ea7b6384b9e24e5ea760ecb710ecda (commit)
from b10a9487702db5d776c09bfa11f8abcb62f7419a (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 663d024598ea7b6384b9e24e5ea760ecb710ecda
Author: Radhika Chippada <radhika at curoverse.com>
Date: Fri Mar 27 13:51:47 2015 -0400
5493: update user_profile test to expect getting_started modal for users with no previous profile configuration;
also, add one more user scenario where prefs exists with getting_started_shown but no profile.
diff --git a/apps/workbench/app/views/application/_getting_started_popup.html.erb b/apps/workbench/app/views/application/_getting_started_popup.html.erb
index 9a792c4..28c3352 100644
--- a/apps/workbench/app/views/application/_getting_started_popup.html.erb
+++ b/apps/workbench/app/views/application/_getting_started_popup.html.erb
@@ -6,7 +6,7 @@
<div class="modal-dialog modal-with-loading-spinner">
<div class="modal-content">
<div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<div>
<div class="col-sm-8"> <h4 class="modal-title"> Getting Started with Arvados </h4> </div>
<div class="spinner spinner-32px spinner-h-center col-sm-1" hidden="true"></div>
diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index 59a2521..1f91e67 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -212,7 +212,9 @@
<div id="getting-started-modal-window"></div>
<% if current_user and !current_user.prefs[:getting_started_shown] and
- !request.url.include?("/user_agreements") and !request.url.include?("/profile") %>
+ !request.url.include?("/profile") and
+ !request.url.include?("/user_agreements") and
+ !request.url.include?("/inactive")%>
<script>
$("#getting-started-modal-window").html("<%= escape_javascript(render partial: 'getting_started_popup') %>");
$("#getting-started-modal-window .modal").modal('show');
diff --git a/apps/workbench/app/views/users/profile.html.erb b/apps/workbench/app/views/users/profile.html.erb
index 82a431c..82c2c15 100644
--- a/apps/workbench/app/views/users/profile.html.erb
+++ b/apps/workbench/app/views/users/profile.html.erb
@@ -88,7 +88,7 @@
<%# If the user has other prefs, we need to preserve them %>
<% current_user.prefs.each do |key, value| %>
- <% if key != 'profile' %>
+ <% if key != :profile %>
<input type="hidden" name="user[prefs][:<%=key%>]" value="<%=value.to_json%>">
<% end %>
<% end %>
diff --git a/apps/workbench/test/integration/user_profile_test.rb b/apps/workbench/test/integration/user_profile_test.rb
index accc6a7..21d9385 100644
--- a/apps/workbench/test/integration/user_profile_test.rb
+++ b/apps/workbench/test/integration/user_profile_test.rb
@@ -10,7 +10,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
Rails.configuration.user_profile_form_fields = @user_profile_form_fields
end
- def verify_homepage_with_profile user, invited, has_profile
+ def verify_homepage_with_profile user, invited, has_profile, getting_started_shown=false
profile_config = Rails.configuration.user_profile_form_fields
if !user
@@ -18,19 +18,30 @@ class UserProfileTest < ActionDispatch::IntegrationTest
elsif user['is_active']
if profile_config && !has_profile
assert page.has_text?('Save profile'), 'No text - Save profile'
- add_profile user
+ add_profile user, invited, has_profile, getting_started_shown
else
assert page.has_text?('Active pipelines'), 'Not found text - Active pipelines'
assert page.has_no_text?('Save profile'), 'Found text - Save profile'
end
elsif invited
- assert page.has_text?('Please check the box below to indicate that you have read and accepted the user agreement'), 'Not found text - Please check the box below . . .'
+ assert page.has_text?('Please check the box below to indicate that you have read and accepted the user agreement'),
+ 'Not found text - Please check the box below . . .'
assert page.has_no_text?('Save profile'), 'Found text - Save profile'
else
assert page.has_text?('Your account is inactive'), 'Not found text - Your account is inactive'
assert page.has_no_text?('Save profile'), 'Found text - Save profile'
end
+ # If the user has not already seen getting_started modal, it will be shown on first visit.
+ if user and user['is_active'] and !user['prefs']['getting_started_shown']
+ within '.modal-content' do
+ assert_text 'Getting Started'
+ assert_selector 'button', text: 'Next'
+ assert_selector 'button', text: 'Prev'
+ first('button', text: 'x').click
+ end
+ end
+
within('.navbar-fixed-top') do
if !user
assert page.has_link?('Log in'), 'Not found link - Log in'
@@ -58,7 +69,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
end
# Check manage profile page and add missing profile to the user
- def add_profile user
+ def add_profile user, invited, has_profile, getting_started_shown
assert page.has_no_text?('My projects'), 'Found text - My projects'
assert page.has_no_text?('Projects shared with me'), 'Found text - Projects shared with me'
@@ -98,7 +109,11 @@ class UserProfileTest < ActionDispatch::IntegrationTest
click_button "Save profile"
# profile saved and in profile page now with success
assert page.has_text?('Thank you for filling in your profile'), 'No text - Thank you for filling'
- click_link 'Back to work!'
+ if getting_started_shown
+ click_link 'Back to work!'
+ else
+ click_link 'Get started'
+ end
# profile saved and in home page now
assert page.has_text?('Active pipelines'), 'No text - Active pipelines'
@@ -112,6 +127,8 @@ class UserProfileTest < ActionDispatch::IntegrationTest
['admin', api_fixture('users')['admin'], true, true],
['active_no_prefs', api_fixture('users')['active_no_prefs'], true, false],
['active_no_prefs_profile', api_fixture('users')['active_no_prefs_profile'], true, false],
+ ['active_no_prefs_profile_with_getting_started_shown',
+ api_fixture('users')['active_no_prefs_profile_with_getting_started_shown'], true, false, true],
].each do |token, user, invited, has_profile|
test "visit home page when profile is configured for user #{token}" do
diff --git a/services/api/test/fixtures/api_client_authorizations.yml b/services/api/test/fixtures/api_client_authorizations.yml
index 0b4d874..9277136 100644
--- a/services/api/test/fixtures/api_client_authorizations.yml
+++ b/services/api/test/fixtures/api_client_authorizations.yml
@@ -181,12 +181,18 @@ active_no_prefs:
api_token: 3kg612cdc0f3415c2428b9758f33bdfb07bc3561b00e86qdmi
expires_at: 2038-01-01 00:00:00
-active_no_prefs_profile:
+active_no_prefs_profile_no_getting_started_shown:
api_client: untrusted
- user: active_no_prefs_profile
+ user: active_no_prefs_profile_no_getting_started_shown
api_token: 3kg612cdc0f3415c242856758f33bdfb07bc3561b00e86qdmi
expires_at: 2038-01-01 00:00:00
+active_no_prefs_profile_with_getting_started_shown:
+ api_client: untrusted
+ user: active_no_prefs_profile_with_getting_started_shown
+ api_token: 3kg612cdc0f3415c245786758f33bdfb07babcd1b00e86qdmi
+ expires_at: 2038-01-01 00:00:00
+
user_foo_in_sharing_group:
api_client: untrusted
user: user_foo_in_sharing_group
diff --git a/services/api/test/fixtures/users.yml b/services/api/test/fixtures/users.yml
index 99b89ab..1457d22 100644
--- a/services/api/test/fixtures/users.yml
+++ b/services/api/test/fixtures/users.yml
@@ -219,7 +219,7 @@ active_no_prefs:
is_admin: false
prefs: {}
-active_no_prefs_profile:
+active_no_prefs_profile_no_getting_started_shown:
owner_uuid: zzzzz-tpzed-000000000000000
uuid: zzzzz-tpzed-a46c98d1td4aoj4
email: active_no_prefs_profile at arvados.local
@@ -230,6 +230,18 @@ active_no_prefs_profile:
is_admin: false
prefs:
test: abc
+
+active_no_prefs_profile_with_getting_started_shown:
+ owner_uuid: zzzzz-tpzed-000000000000000
+ uuid: zzzzz-tpzed-getstartnoprofl
+ email: active_no_prefs_profile at arvados.local
+ first_name: HasPrefs
+ last_name: NoProfileWithGettingStartedShown
+ identity_url: https://active_no_prefs_profile_seen_gs.openid.local
+ is_active: true
+ is_admin: false
+ prefs:
+ test: abc
getting_started_shown: 2015-03-26 12:34:56.789000000 Z
# Fixtures to test granting and removing permissions.
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list