fix missing site admin warning for custom roles
iow, ensure ENV.ACCOUNT always appears on account settings test plan: - a custom role with manage_feature_flags permission that does _not_ have manage_storage_quotas permission should still get the "are you sure" warning when modifying feature settings in site admin fixes ADMIN-2830 Change-Id: I771777586be2e5aad12b53ebf7b48dfc0d5dd413 Reviewed-on: https://gerrit.instructure.com/205182 Tested-by: Jenkins Reviewed-by: James Williams <jamesw@instructure.com> QA-Review: KC Naegle <knaegle@instructure.com> Product-Review: Jeremy Stanley <jeremy@instructure.com>
This commit is contained in:
parent
b4c0dd74cc
commit
3cc0448923
|
@ -19,16 +19,22 @@
|
|||
js_bundle :account_settings
|
||||
css_bundle :account_settings, :reports, :tinymce
|
||||
provide :page_title, t(:page_title, "Account Settings")
|
||||
if can_do(@context, @current_user, :manage_storage_quotas)
|
||||
js_env :ACCOUNT => {
|
||||
|
||||
js_env(
|
||||
:ACCOUNT => {
|
||||
'id' => @context.id,
|
||||
'default_storage_quota_mb' => @context.default_storage_quota_mb,
|
||||
'default_user_storage_quota_mb' => @context.default_user_storage_quota_mb,
|
||||
'default_group_storage_quota_mb' => @context.default_group_storage_quota_mb,
|
||||
'site_admin' => @account.site_admin?,
|
||||
'root_account' => @account.root_account?
|
||||
}
|
||||
end
|
||||
}.tap do |h|
|
||||
if can_do(@context, @current_user, :manage_storage_quotas)
|
||||
h.merge!(
|
||||
'default_storage_quota_mb' => @context.default_storage_quota_mb,
|
||||
'default_user_storage_quota_mb' => @context.default_user_storage_quota_mb,
|
||||
'default_group_storage_quota_mb' => @context.default_group_storage_quota_mb
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
%>
|
||||
<% provide :right_side do %>
|
||||
<%= render :partial => "additional_settings_right_side" %>
|
||||
|
|
|
@ -297,7 +297,8 @@ describe "accounts/settings.html.erb" do
|
|||
|
||||
it "should show quota options" do
|
||||
render
|
||||
expect(@controller.js_env.include?(:ACCOUNT)).to be_truthy
|
||||
expect(@controller.js_env).to include :ACCOUNT
|
||||
expect(@controller.js_env[:ACCOUNT]).to include 'default_storage_quota_mb'
|
||||
expect(response).to have_tag '#tab-quotas-link'
|
||||
expect(response).to have_tag '#tab-quotas'
|
||||
end
|
||||
|
@ -312,7 +313,8 @@ describe "accounts/settings.html.erb" do
|
|||
|
||||
it "should not show quota options" do
|
||||
render
|
||||
expect(@controller.js_env.include?(:ACCOUNT)).to be_falsey
|
||||
expect(@controller.js_env).to include :ACCOUNT
|
||||
expect(@controller.js_env[:ACCOUNT]).not_to include 'default_storage_quota_mb'
|
||||
expect(response).not_to have_tag '#tab-quotas-link'
|
||||
expect(response).not_to have_tag '#tab-quotas'
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue