Skip to content

Commit

Permalink
fixed bad link between admin to supervisor link on case contact
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanTurner committed Aug 26, 2021
1 parent 1f20d75 commit 56d1b82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/case_contacts/_case_contact.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<%= contact.creator&.display_name %>
<% else %>
<% if contact.creator&.supervisor? %>
<%= link_to contact.creator&.display_name, edit_supervisor_path(current_user) %>
<%= link_to contact.creator&.display_name, edit_supervisor_path(contact.creator) %>
<% elsif contact.creator&.casa_admin? %>
<%= link_to contact.creator&.display_name, edit_users_path %>
<% else %>
Expand Down
8 changes: 8 additions & 0 deletions spec/system/casa_cases/show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
expect(page).to have_link(href: "/supervisors/#{user.id}/edit")
end

context "case contact by another supervisor" do
let(:other_supervisor) { create(:supervisor, casa_org: organization) }
let!(:case_contact) { create(:case_contact, creator: other_supervisor, casa_case: casa_case) }
it "sees link to other supervisor" do
expect(page).to have_link(href: "/supervisors/#{other_supervisor.id}/edit")
end
end

it "can see court mandates" do
expect(page).to have_content("Court Mandates")
expect(page).to have_content(casa_case.case_court_mandates[0].mandate_text)
Expand Down

0 comments on commit 56d1b82

Please sign in to comment.