Skip to content

Commit fa8d0a4

Browse files
committed
add tests for placement types on casa org edit
1 parent 50fb1b5 commit fa8d0a4

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

app/views/casa_org/_placement_types.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</div>
1818
</div>
1919
<div class="table-wrapper table-responsive">
20-
<table class="table striped-table" id="contact-types">
20+
<table class="table striped-table" id="placement-types-table">
2121
<thead>
2222
<tr>
2323
<th>Name</th>

app/views/casa_org/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<div class="col-md-6">
173173
<div class="title mb-30">
174174
<h2 id="placement-types">
175-
Manage Placement Types
175+
Manage Case Placement Types
176176
</h2>
177177
</div>
178178
</div>

spec/views/casa_orgs/edit.html.erb_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
assign(:sent_emails, [])
1212
assign(:contact_topics, [])
1313
assign(:custom_org_links, [])
14+
assign(:placement_types, [])
1415

1516
sign_in build_stubbed(:casa_admin)
1617
end
@@ -103,6 +104,24 @@
103104
expect(rendered).to have_text(judge.name)
104105
end
105106

107+
it "has placement types content" do
108+
organization = build_stubbed(:casa_org)
109+
allow(view).to receive(:current_organization).and_return(organization)
110+
placement_type = build_stubbed(:placement_type, name: "Placement type 1")
111+
placement_type_2 = build_stubbed(:placement_type, name: "Placement type 2")
112+
assign(:placement_types, [placement_type, placement_type_2])
113+
114+
render template: "casa_org/edit"
115+
116+
expect(rendered).to have_text("Manage Case Placement Types")
117+
expect(rendered).to have_table("placement-types-table",
118+
with_rows:
119+
[
120+
["Placement type 1", "Edit"],
121+
["Placement type 2", "Edit"]
122+
])
123+
end
124+
106125
it "does not show download prompt with no custom template" do
107126
organization = build_stubbed(:casa_org)
108127
allow(view).to receive(:current_organization).and_return(organization)

0 commit comments

Comments
 (0)