Skip to content

Commit 65758bb

Browse files
committed
stubs for new tests
1 parent 90d76fa commit 65758bb

1 file changed

Lines changed: 45 additions & 8 deletions

File tree

spec/system/court_dates/view_spec.rb

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,57 @@
11
require "rails_helper"
22

33
RSpec.describe "court_dates/edit", type: :system do
4-
context "with date"
54
let(:now) { Date.new(2021, 1, 1) }
6-
let(:organization) { create(:casa_org) }
7-
let(:admin) { create(:casa_admin, casa_org: organization) }
8-
let(:volunteer) { create(:volunteer) }
9-
let(:supervisor) { create(:casa_admin, casa_org: organization) }
10-
let!(:casa_case) { create(:casa_case, casa_org: organization) }
11-
let!(:court_date) { create(:court_date, :with_court_details, casa_case: casa_case, date: now - 1.week) }
12-
let!(:future_court_date) { create(:court_date, :with_court_details, casa_case: casa_case, date: now + 1.week) }
5+
let(:organization_containing_court_date) { create(:casa_org) }
6+
let(:organization_not_containing_court_date) { create(:casa_org) }
7+
let(:admin) { create(:casa_admin, casa_org: organization_containing_court_date) }
8+
let(:volunteer) { create(:volunteer, casa_org: organization_containing_court_date) }
9+
let!(:casa_case) { create(:casa_case, casa_org: organization_containing_court_date) }
10+
let!(:court_date) { create(:court_date, :with_court_details, casa_case: casa_case, date: now + 1.week) }
1311

1412
before do
1513
travel_to now
1614
end
1715

16+
shared_examples "user can view court date" do |user_type, organization|
17+
let(:user) { create(user_type, casa_org: organization) }
18+
19+
before(:all) do
20+
sign_in user
21+
visit casa_case_court_date_path(casa_case, court_date)
22+
end
23+
24+
it "can visit the court order page" do
25+
expect(page).not_to have_content "Sorry, you are not authorized to perform this action."
26+
end
27+
28+
it "can see the court date" do
29+
end
30+
31+
it "can see the associated case number" do
32+
end
33+
34+
it "can see the associated court report due date" do
35+
end
36+
37+
it "can see the associated judge" do
38+
end
39+
40+
it "can see the associated hearing type" do
41+
end
42+
43+
it "can see associated court orders" do
44+
end
45+
end
46+
47+
shared_examples "user cannot view court date" do |user_type, organization|
48+
let(:user) { create(user_type, casa_org: organization) }
49+
50+
it "is not allowed to visit the court order page" do
51+
expect(page).to have_content "Sorry, you are not authorized to perform this action."
52+
end
53+
end
54+
1855
context "as a volunteer" do
1956
it "can download a report which focuses on the court date", :js do
2057
volunteer.casa_cases = [casa_case]

0 commit comments

Comments
 (0)