|
2 | 2 |
|
3 | 3 | RSpec.describe "court_dates/edit", type: :system do |
4 | 4 | let(:now) { Date.new(2021, 1, 1) } |
5 | | - let(:organization_containing_court_date) { create(:casa_org) } |
| 5 | + let(:organization) { create(:casa_org) } |
6 | 6 | let(:admin) { create(:casa_admin, casa_org: organization_containing_court_date) } |
7 | 7 | let(:volunteer) { create(:volunteer, casa_org: organization_containing_court_date) } |
8 | 8 | let!(:casa_case) { create(:casa_case, casa_org: organization_containing_court_date) } |
|
43 | 43 | end |
44 | 44 | end |
45 | 45 |
|
46 | | - shared_examples "user unable to view court date" do |user_type, organization| |
| 46 | + shared_examples "user unable to view court date" do |user_type| |
47 | 47 | let(:user) { create(user_type, casa_org: organization) } |
48 | 48 |
|
49 | 49 | it "is not allowed to visit the court order page" do |
|
55 | 55 | end |
56 | 56 |
|
57 | 57 | context "as a user from an organization not containing the court date" do |
58 | | - let(:organization_not_containing_court_date) { create(:casa_org) } |
| 58 | + let(:organization) { create(:casa_org) } |
59 | 59 |
|
60 | | - it_should_behave_like "user unable to view court date", :admin, organization_not_containing_court_date |
| 60 | + it_should_behave_like "user unable to view court date", :admin |
61 | 61 | end |
62 | 62 |
|
63 | 63 | context "as a volunteer not assigned to the case associated with the court case" do |
64 | | - let(:other_volunteer) { create(:volunteer, casa_org: organization_containing_court_date) } |
65 | | - |
66 | | - it_should_behave_like "user unable to view court date", :volunteer, organization_containing_court_date |
| 64 | + it_should_behave_like "user unable to view court date", :volunteer |
67 | 65 | end |
68 | 66 |
|
69 | 67 | context "as a volunteer" do |
|
0 commit comments