|
77 | 77 | let(:team) { create(:team) } |
78 | 78 |
|
79 | 79 | context "without an archive reason" do |
| 80 | + before { create(:patient_team, team:, patient:) } |
| 81 | + |
80 | 82 | it { should_not include(patient) } |
81 | 83 | end |
82 | 84 |
|
83 | 85 | context "with an archive reason for the team" do |
84 | | - before { create(:archive_reason, :moved_out_of_area, team:, patient:) } |
| 86 | + before { create(:patient_team, :archive_reason, team:, patient:) } |
85 | 87 |
|
86 | 88 | it { should include(patient) } |
87 | 89 | end |
88 | 90 |
|
89 | 91 | context "with an archive reason for a different team" do |
90 | | - before { create(:archive_reason, :imported_in_error, patient:) } |
| 92 | + before do |
| 93 | + create(:patient_team, team:, patient:) |
| 94 | + create(:patient_team, :archive_reason, team: create(:team), patient:) |
| 95 | + end |
91 | 96 |
|
92 | 97 | it { should_not include(patient) } |
93 | 98 | end |
|
100 | 105 | let(:team) { create(:team) } |
101 | 106 |
|
102 | 107 | context "without an archive reason" do |
| 108 | + before { create(:patient_team, team:, patient:) } |
| 109 | + |
103 | 110 | it { should include(patient) } |
104 | 111 | end |
105 | 112 |
|
106 | 113 | context "with an archive reason for the team" do |
107 | | - before { create(:archive_reason, :moved_out_of_area, team:, patient:) } |
| 114 | + before { create(:patient_team, :archive_reason, team:, patient:) } |
108 | 115 |
|
109 | 116 | it { should_not include(patient) } |
110 | 117 | end |
111 | 118 |
|
112 | 119 | context "with an archive reason for a different team" do |
113 | | - before { create(:archive_reason, :imported_in_error, patient:) } |
| 120 | + before do |
| 121 | + create(:patient_team, team:, patient:) |
| 122 | + create(:patient_team, :archive_reason, team: create(:team), patient:) |
| 123 | + end |
114 | 124 |
|
115 | 125 | it { should include(patient) } |
116 | 126 | end |
|
122 | 132 | let(:team) { create(:team) } |
123 | 133 | let(:patient) { create(:patient) } |
124 | 134 |
|
| 135 | + before { create(:patient_team, team:, patient:) } |
| 136 | + |
125 | 137 | context "without pending changes" do |
126 | 138 | it { should_not include(patient) } |
127 | 139 | end |
|
0 commit comments