Skip to content

Commit

Permalink
Add red message when there are no active volunteers
Browse files Browse the repository at this point in the history
to assign to a CASA case
  • Loading branch information
Garbar committed Jul 30, 2020
1 parent ac96f76 commit 99f10b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/supervisors/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,8 @@

<%= form.submit 'Assign Volunteer', class: 'btn btn-primary' %>
<% end %>
<% unless @available_volunteers.any? %>
<p class="text-danger">There are no active, unassigned volunteers available.</p>
<% end %>
</div>
</div>
14 changes: 14 additions & 0 deletions spec/features/admin_views_dashboard_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,18 @@

expect(page).to have_text("Editing Supervisor")
end

it "can go to the supervisor edit page and see red message
when there are no active volunteers" do
create(:user, :supervisor)
sign_in admin

visit root_path

within "#supervisors" do
click_on "Edit"
end

expect(page).to have_text("There are no active, unassigned volunteers available")
end
end

0 comments on commit 99f10b4

Please sign in to comment.