diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 39658937889..685b45a5c24 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -823,12 +823,12 @@ module ApplicationHelper end def dashboard_url(opts={}) - return super(opts) if opts[:login_success] + return super(opts) if opts[:login_success] || opts[:become_user_id] custom_dashboard_url || super(opts) end def dashboard_path(opts={}) - return super(opts) if opts[:login_success] + return super(opts) if opts[:login_success] || opts[:become_user_id] custom_dashboard_url || super(opts) end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index efbf1fb6847..14076c37c2c 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -477,8 +477,16 @@ describe ApplicationHelper do expect(dashboard_url).to eq "http://foo.bar" end - it "with login_success=1, returns a regular canvas dashboard url" do - expect(dashboard_url(:login_success => '1')).to eq "http://test.host/?login_success=1" + context "with login_success=1" do + it "returns a regular canvas dashboard url" do + expect(dashboard_url(:login_success => '1')).to eq "http://test.host/?login_success=1" + end + end + + context "with become_user_id=1" do + it "returns a regular canvas dashboard url for masquerading" do + expect(dashboard_url(:become_user_id => '1')).to eq "http://test.host/?become_user_id=1" + end end context "with a user logged in" do