Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change button from 'Promote to Admin' to 'Edit User' #4701

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions app/views/users/_organization_user.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
<ul class="dropdown-menu">
<li>
<%=
edit_button_to(
promote_to_org_admin_organization_path(user_id: user.id),
{text: 'Promote to Admin'},
{method: :post, rel: "nofollow", data: {confirm: 'This will promote the user to admin status. Are you sure that you want to submit this?', size: 'xs'}}
)
edit_button_to(
edit_admin_user_path(user),
{text: 'Edit User'}
)
%>
</li>
<li>
Expand Down
11 changes: 11 additions & 0 deletions spec/requests/admin/organizations_requests_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@
get admin_organization_path({ id: organization.id })
expect(response).to be_successful
end

context "with an organization user" do
let!(:user) { create(:user, organization: organization) }

it "provides links to edit the user" do
get admin_organization_path({ id: organization.id })

expect(response.body).to include("Edit User")
expect(response.body).to include(edit_admin_user_path(user.id))
end
end
end

describe "PUT #update" do
Expand Down