rename /profile/edit -> /profile/settings

There is some wording that should change as well, but I think we're
redoing the settings page soon so I'm going to leave that alone for now.

Test plan:
  * Click on the page to edit your profile, the URL should be
    /profile/settings instead of /profile/edit

Change-Id: Ida9ff2b24c1dc53b07cdf6c17a99152f8c5956af
Reviewed-on: https://gerrit.instructure.com/12134
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Cameron Matheson <cameron@instructure.com>
This commit is contained in:
Cameron Matheson 2012-07-10 17:26:30 -06:00
parent e7cb8fa354
commit 58ca5884a2
10 changed files with 46 additions and 46 deletions

View File

@ -32,7 +32,7 @@ class ProfileController < ApplicationController
# this is ghetto and we should get rid of this as soon as possible
@current_user.instance_variable_set(:@show_profile_tab, true)
else
edit
settings
return
end
@ -90,7 +90,7 @@ class ProfileController < ApplicationController
# 'avatar_url': '..url..',
# 'calendar': { 'ics' => '..url..' }
# }
def edit
def settings
if @current_user && @domain_root_account.enable_profiles?
@current_user.instance_variable_set(:@show_profile_tab, true)
end
@ -112,10 +112,10 @@ class ProfileController < ApplicationController
@pseudonyms = @user.pseudonyms.active
@password_pseudonyms = @pseudonyms.select{|p| !p.managed_password? }
@context = UserProfile.new(@user)
@active_tab = "edit_profile"
@active_tab = "profile_settings"
respond_to do |format|
format.html do
add_crumb(t(:crumb, "%{user}'s profile", :user => @user.short_name), edit_profile_path )
add_crumb(t(:crumb, "%{user}'s profile", :user => @user.short_name), settings_profile_path )
render :action => "profile"
end
format.json do

View File

@ -33,7 +33,7 @@ class UserProfile
{ :id => TAB_HOME, :label => I18n.t('#tabs.home', "Home"), :css_class => 'home', :href => :dashboard_path, :no_args => true },
{ :id => TAB_COMMUNICATION_PREFERENCES, :label => I18n.t('#user_profile.tabs.notifications', "Notifications"), :css_class => 'notifications', :href => :communication_profile_path, :no_args => true },
{ :id => TAB_FILES, :label => I18n.t('#tabs.files', "Files"), :css_class => 'files', :href => :dashboard_files_path, :no_args => true },
{ :id => TAB_PROFILE_SETTINGS, :label => I18n.t('#user_profile.tabs.settings', 'Settings'), :css_class => 'edit_profile', :href => :edit_profile_path, :no_args => true },
{ :id => TAB_PROFILE_SETTINGS, :label => I18n.t('#user_profile.tabs.settings', 'Settings'), :css_class => 'profile_settings', :href => :settings_profile_path, :no_args => true },
]
if user && user.instance_variable_get(:@show_profile_tab)
@tabs.insert 1, {:id => TAB_PROFILE, :label => I18n.t('#user_profile.tabs.profile', "Profile"), :css_class => 'profile', :href => :user_profile_path, :args => [user]}

View File

@ -65,7 +65,7 @@
</style>
<% end %>
<h2><%= t('headings.registered_services', %{Registered Services}) %></h2>
<a href="<%= edit_profile_path %>" class="profile_url" style="display: none;">&nbsp;</a>
<a href="<%= settings_profile_path %>" class="profile_url" style="display: none;">&nbsp;</a>
<p>
<%= t 'help.user_services', %{If other members choose, they can let you see which outside services they've linked to their Canvas account. This can make it easier to coordinate group projects and also link up outside of class.} %>
</p>
@ -74,7 +74,7 @@
<%= t 'help.no_services', %{You haven't linked your user profile to any external services. You can link your Canvas account to services like Facebook and Twitter.} %>
</p>
<p>
<a href="<%= edit_profile_path %>#registered_web_services" class="button"><%= t('links.link_service', %{Link web services to my account}) %></a>
<a href="<%= settings_profile_path %>#registered_web_services" class="button"><%= t('links.link_service', %{Link web services to my account}) %></a>
</p>
<% elsif @current_user && !@current_user.show_user_services %>
<p>
@ -113,7 +113,7 @@
<a href="<%= UserService.registration_url(service_type) %>"><%= t('links.sign_up_for_service', %{Sign Up}) %></a>
|
<% end %>
<a href="<%= edit_profile_path %>#register_<%= service_type %>"><%= t('links.link_existing_service_account', %{Link Existing Account}) %></a>
<a href="<%= settings_profile_path %>#register_<%= service_type %>"><%= t('links.link_existing_service_account', %{Link Existing Account}) %></a>
</li>
<% end %>
</ul>

View File

@ -7,7 +7,7 @@
<li><%= link_to t('links.log_in', "Log In"), login_path %></li>
<% end %>
<% else %>
<li class="user_name"><%= link_to @current_user.short_name, edit_profile_path %></li>
<li class="user_name"><%= link_to @current_user.short_name, settings_profile_path %></li>
<% if @real_current_user && @real_current_user != @current_user && !@current_user.fake_student? %>
<li class="stop_masquerading"><%= link_to t('links.stop_masquerading', "[Stop Masquerading]"), user_masquerade_url(@real_current_user.id), :method => :post %></li>
<% end %>
@ -17,7 +17,7 @@
<b class="unread-messages-count"><%= unread %></b>
<% end %>
</a></li>
<li><%= link_to t('links.profile', "Profile"), edit_profile_path %></li>
<li><%= link_to t('links.profile', "Profile"), settings_profile_path %></li>
<% end %>
<li class="user_id" style="display: none;"><%= @current_user.id %></li>
<li class="course_id" style="display: none;"><%= @context.id if @context && @context.is_a?(Course) %></li>

View File

@ -527,9 +527,9 @@ ActionController::Routing::Routes.draw do |map|
user.resources :messages, :only => [:index]
end
map.resource :profile, :only => %w(show edit update),
map.resource :profile, :only => %w(show update),
:controller => "profile",
:member => { :communication => :get, :update_communication => :post } do |profile|
:member => { :communication => :get, :update_communication => :post, :settings => :get } do |profile|
profile.resources :pseudonyms, :except => %w(index)
profile.resources :tokens, :except => %w(index)
profile.pics 'profile_pictures', :controller => 'profile', :action => 'profile_pics'
@ -811,7 +811,7 @@ ActionController::Routing::Routes.draw do |map|
end
api.get 'users/:user_id/page_views', :controller => :page_views, :action => :index, :path_name => 'user_page_views'
api.get 'users/:user_id/profile', :controller => :profile, :action => :edit
api.get 'users/:user_id/profile', :controller => :profile, :action => :settings
api.get 'users/:user_id/avatars', :controller => :profile, :action => :profile_pics
api.with_options(:controller => :conversations) do |conversations|

View File

@ -522,7 +522,7 @@ describe "API Authentication", :type => :integration do
user_with_pseudonym(:user => @user)
json = api_call(:get, "/api/v1/users/self/profile?as_user_id=#{@student.id}",
:controller => "profile", :action => "edit", :user_id => 'self', :format => 'json', :as_user_id => @student.id.to_param)
:controller => "profile", :action => "settings", :user_id => 'self', :format => 'json', :as_user_id => @student.id.to_param)
assigns['current_user'].should == @student
assigns['current_pseudonym'].should == @student_pseudonym
assigns['real_current_user'].should == @user
@ -541,7 +541,7 @@ describe "API Authentication", :type => :integration do
@user = @student
user_with_pseudonym(:user => @user, :username => "nobody2@example.com")
raw_api_call(:get, "/api/v1/users/self/profile?as_user_id=#{@admin.id}",
:controller => "profile", :action => "edit", :user_id => 'self', :format => 'json', :as_user_id => @admin.id.to_param)
:controller => "profile", :action => "settings", :user_id => 'self', :format => 'json', :as_user_id => @admin.id.to_param)
assigns['current_user'].should == @student
assigns['real_current_user'].should be_nil
json.should == {
@ -556,7 +556,7 @@ describe "API Authentication", :type => :integration do
# as_user_id is ignored if it's blank
raw_api_call(:get, "/api/v1/users/self/profile?as_user_id=",
:controller => "profile", :action => "edit", :user_id => 'self', :format => 'json', :as_user_id => '')
:controller => "profile", :action => "settings", :user_id => 'self', :format => 'json', :as_user_id => '')
assigns['current_user'].should == @student
assigns['real_current_user'].should be_nil
json.should == {
@ -576,7 +576,7 @@ describe "API Authentication", :type => :integration do
@student_pseudonym.update_attribute(:sis_user_id, "1234")
json = api_call(:get, "/api/v1/users/self/profile?as_user_id=sis_user_id:#{@student.pseudonym.sis_user_id}",
:controller => "profile", :action => "edit", :user_id => 'self', :format => 'json', :as_user_id => "sis_user_id:#{@student.pseudonym.sis_user_id.to_param}")
:controller => "profile", :action => "settings", :user_id => 'self', :format => 'json', :as_user_id => "sis_user_id:#{@student.pseudonym.sis_user_id.to_param}")
assigns['current_user'].should == @student
assigns['real_current_pseudonym'].should == @pseudonym
assigns['real_current_user'].should == @user
@ -598,7 +598,7 @@ describe "API Authentication", :type => :integration do
user_with_pseudonym(:user => @user)
raw_api_call(:get, "/api/v1/users/self/profile?as_user_id=sis_user_id:bogus",
:controller => "profile", :action => "edit", :user_id => 'self', :format => 'json', :as_user_id => "sis_user_id:bogus")
:controller => "profile", :action => "settings", :user_id => 'self', :format => 'json', :as_user_id => "sis_user_id:bogus")
response.status.should == '401 Unauthorized'
JSON.parse(response.body).should == { 'errors' => 'Invalid as_user_id' }
end
@ -608,7 +608,7 @@ describe "API Authentication", :type => :integration do
@user = @student
raw_api_call(:get, "/api/v1/users/self/profile?as_user_id=#{@admin.id}",
:controller => "profile", :action => "edit", :user_id => 'self', :format => 'json', :as_user_id => @admin.id.to_param)
:controller => "profile", :action => "settings", :user_id => 'self', :format => 'json', :as_user_id => @admin.id.to_param)
response.status.should == '401 Unauthorized'
JSON.parse(response.body).should == { 'errors' => 'Invalid as_user_id' }
end
@ -625,7 +625,7 @@ describe "API Authentication", :type => :integration do
it "should not prepend the CSRF protection to API requests" do
user_with_pseudonym(:user => @user)
raw_api_call(:get, "/api/v1/users/self/profile",
:controller => "profile", :action => "edit", :user_id => "self", :format => "json")
:controller => "profile", :action => "settings", :user_id => "self", :format => "json")
response.should be_success
raw_json = response.body
raw_json.should_not match(%r{^while\(1\);})

View File

@ -186,7 +186,7 @@ describe "Users API", :type => :integration do
it "should return another user's profile, if allowed" do
json = api_call(:get, "/api/v1/users/#{@student.id}/profile",
:controller => "profile", :action => "edit", :user_id => @student.to_param, :format => 'json')
:controller => "profile", :action => "settings", :user_id => @student.to_param, :format => 'json')
json.should == {
'id' => @student.id,
'name' => 'Student',
@ -213,7 +213,7 @@ describe "Users API", :type => :integration do
@course.enroll_user(new_user, 'ObserverEnrollment')
Account.site_admin.add_user(@user)
json = api_call(:get, "/api/v1/users/#{new_user.id}/profile",
:controller => "profile", :action => "edit", :user_id => new_user.to_param, :format => 'json')
:controller => "profile", :action => "settings", :user_id => new_user.to_param, :format => 'json')
json.should == {
'id' => new_user.id,
'name' => 'new guy',
@ -229,7 +229,7 @@ describe "Users API", :type => :integration do
it "should return this user's profile" do
json = api_call(:get, "/api/v1/users/self/profile",
:controller => "profile", :action => "edit", :user_id => 'self', :format => 'json')
:controller => "profile", :action => "settings", :user_id => 'self', :format => 'json')
json.should == {
'id' => @admin.id,
'name' => 'User',
@ -245,7 +245,7 @@ describe "Users API", :type => :integration do
it "should return this user's profile (non-admin)" do
@user = @student
json = api_call(:get, "/api/v1/users/#{@student.id}/profile",
:controller => "profile", :action => "edit", :user_id => @student.to_param, :format => 'json')
:controller => "profile", :action => "settings", :user_id => @student.to_param, :format => 'json')
json.should == {
'id' => @student.id,
'name' => 'Student',
@ -268,7 +268,7 @@ describe "Users API", :type => :integration do
it "shouldn't return disallowed profiles" do
@user = @student
raw_api_call(:get, "/api/v1/users/#{@admin.id}/profile",
:controller => "profile", :action => "edit", :user_id => @admin.to_param, :format => 'json')
:controller => "profile", :action => "settings", :user_id => @admin.to_param, :format => 'json')
response.status.should == "401 Unauthorized"
JSON.parse(response.body).should == {"status"=>"unauthorized", "message"=>"You are not authorized to perform that action."}
end

View File

@ -26,7 +26,7 @@ describe ProfileController do
u.save!
user_session(u, u.pseudonyms.first)
get '/profile/edit'
get '/profile/settings'
Nokogiri::HTML(response.body).css('input#user_short_name').should_not be_empty
put '/profile', :user => { :short_name => 'Cody' }
@ -35,7 +35,7 @@ describe ProfileController do
a.settings[:users_can_edit_name] = false
a.save!
get '/profile/edit'
get '/profile/settings'
Nokogiri::HTML(response.body).css('input#user_short_name').should be_empty
put '/profile', :user => { :short_name => 'JT' }
@ -47,7 +47,7 @@ describe ProfileController do
course_with_teacher_logged_in(:active_all => true)
enter_student_view
get '/profile/edit'
get '/profile/settings'
assert_unauthorized
end
end

View File

@ -267,4 +267,4 @@ describe "eportfolios file upload" do
#cannot test downloading the file, will check in the future
#check_file(download)
end
end
end

View File

@ -56,7 +56,7 @@ describe "profile" do
it "should change the password" do
user_with_pseudonym({:active_user => true})
login_as
get '/profile/edit'
get '/profile/settings'
old_password = 'asdfasdf'
new_password = 'newpassword'
edit_form = click_edit
@ -87,7 +87,7 @@ describe "profile" do
notification_model(:category => 'Grading')
notification_policy_model(:notification_id => @notification.id)
if add_with == 'on profile page'
get '/profile/edit'
get '/profile/settings'
add_email_link
else
get "/profile/communication"
@ -119,7 +119,7 @@ describe "profile" do
notification_model(:category => 'Grading')
get "/profile/edit"
get "/profile/settings"
#Test modifying notifications
driver.find_element(:css, '#section-tabs .notifications').click
content_tbody = driver.find_element(:css, '#content > table > tbody')
@ -158,14 +158,14 @@ describe "profile" do
end
it "should display file uploader link on files page" do
get "/profile/edit"
get "/profile/settings"
expect_new_page_load { driver.find_element(:css, '#left-side .files').click }
driver.find_element(:id, 'file_swfUploader').should be_displayed
end
it "should edit full name" do
new_user_name = 'new user name'
get "/profile/edit"
get "/profile/settings"
edit_form = click_edit
edit_form.find_element(:id, 'user_name').send_keys(new_user_name)
submit_form(edit_form)
@ -175,7 +175,7 @@ describe "profile" do
it "should edit display name and validate" do
new_display_name = 'test name'
get "/profile/edit"
get "/profile/settings"
edit_form = click_edit
edit_form.find_element(:id, 'user_short_name').send_keys(new_display_name)
submit_form(edit_form)
@ -185,7 +185,7 @@ describe "profile" do
end
it "should change the language" do
get "/profile/edit"
get "/profile/settings"
edit_form = click_edit
click_option('#user_locale', 'Español')
expect_new_page_load { submit_form(edit_form) }
@ -197,7 +197,7 @@ describe "profile" do
a.settings[:users_can_edit_name] = false
a.save!
get "/profile/edit"
get "/profile/settings"
edit_form = click_edit
edit_form.find_elements(:id, 'user_short_name').first.should be_nil
click_option('#user_locale', 'Español')
@ -207,7 +207,7 @@ describe "profile" do
it "should add another contact method - sms" do
test_cell_number = '8017121011'
get "/profile/edit"
get "/profile/settings"
driver.find_element(:css, '.add_contact_link').click
register_form = driver.find_element(:id, 'register_sms_number')
register_form.find_element(:css, '.sms_number').send_keys(test_cell_number)
@ -219,12 +219,12 @@ describe "profile" do
end
it "should register a service" do
get "/profile/edit"
get "/profile/settings"
add_skype_service
end
it "should delete a service" do
get "/profile/edit"
get "/profile/settings"
add_skype_service
#had to use add class because tests were failing inconsistently in aws
driver.execute_script("$('.service').addClass('service-hover')")
@ -236,7 +236,7 @@ describe "profile" do
end
it "should toggle service visibility" do
get "/profile/edit"
get "/profile/settings"
add_skype_service
initial_state = @user.show_user_services
@ -250,12 +250,12 @@ describe "profile" do
end
it "should generate a new access token" do
get "/profile/edit"
get "/profile/settings"
generate_access_token
end
it "should test canceling creating a new access token" do
get "/profile/edit"
get "/profile/settings"
driver.find_element(:css, '.add_access_token_link').click
access_token_form = driver.find_element(:id, 'access_token_form')
access_token_form.find_element(:css, '.cancel_button').click
@ -263,7 +263,7 @@ describe "profile" do
end
it "should view the details of an access token" do
get "/profile/edit"
get "/profile/settings"
generate_access_token('testing', true)
#had to use :visible because it was failing saying element wasn't visible
find_with_jquery('#access_tokens .show_token_link:visible').click
@ -271,7 +271,7 @@ describe "profile" do
end
it "should delete an access token" do
get "/profile/edit"
get "/profile/settings"
generate_access_token('testing', true)
#had to use :visible because it was failing saying element wasn't visible
find_with_jquery("#access_tokens .delete_key_link:visible").click
@ -326,7 +326,7 @@ shared_examples_for "profile pictures selenium tests" do
a.save!
IMAGE_SRC = ''
get "/profile/edit"
get "/profile/settings"
keep_trying_until { f(".profile_pic_link") }.click
dialog = f("#profile_pic_dialog")
dialog.should be_displayed