Skip to content

Commit

Permalink
Change button from 'Promote to Admin' to 'Edit User' (#4701)
Browse files Browse the repository at this point in the history
* Change button from 'Promote to Admin' to 'Edit User'

* Replace system spec with request spec for link for editing user

* Replace system spec with request spec for link for editing user
  • Loading branch information
leslie-seeberger authored Oct 10, 2024
1 parent ee78309 commit 93b53f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
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

0 comments on commit 93b53f3

Please sign in to comment.