|
1 | 1 | require "rails_helper" |
2 | | - |
| 2 | +# hi |
3 | 3 | RSpec.describe "/case_contacts", type: :request do |
4 | 4 | let(:organization) { build(:casa_org) } |
5 | 5 | let(:admin) { create(:casa_admin, casa_org: organization) } |
|
21 | 21 |
|
22 | 22 | it { is_expected.to have_http_status(:success) } |
23 | 23 |
|
24 | | - it "returns all case contacts" do |
25 | | - page = request.parsed_body.to_html |
26 | | - expect(page).to include(past_contact.creator.display_name, recent_contact.creator.display_name) |
27 | | - end |
28 | | - |
29 | | - context "with filters applied" do |
30 | | - let(:filterrific) { {occurred_starting_at: 1.week.ago} } |
31 | | - |
| 24 | + context "when logged in as an admin" do |
32 | 25 | it "returns all case contacts" do |
33 | 26 | page = request.parsed_body.to_html |
34 | | - expect(page).to include(recent_contact.creator.display_name) |
35 | | - expect(page).not_to include(past_contact.creator.display_name) |
| 27 | + expect(page).to include(past_contact.creator.display_name, recent_contact.creator.display_name) |
| 28 | + end |
| 29 | + |
| 30 | + context "with filters applied" do |
| 31 | + let(:filterrific) { {occurred_starting_at: 1.week.ago} } |
| 32 | + |
| 33 | + it "returns all case contacts" do |
| 34 | + page = request.parsed_body.to_html |
| 35 | + expect(page).to include(recent_contact.creator.display_name) |
| 36 | + expect(page).not_to include(past_contact.creator.display_name) |
| 37 | + end |
36 | 38 | end |
37 | 39 | end |
38 | 40 |
|
| 41 | + |
39 | 42 | context "when logged in as a volunteer" do |
40 | 43 | let(:assigned_case) { create(:casa_case, :with_one_case_assignment, casa_org: organization) } |
41 | 44 | let(:unassigned_case) { casa_case } |
|
0 commit comments