Skip to content

Commit f5589a2

Browse files
committed
Adding test for programmes on index
1 parent 12d18ea commit f5589a2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spec/requests/admin/programmes_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@
3636
it "should render correct template" do
3737
expect(response).to render_template("index")
3838
end
39+
40+
it "displays all available programmes" do
41+
programmes = [
42+
Programme.cs_accelerator,
43+
Programme.primary_certificate,
44+
Programme.secondary_certificate,
45+
Programme.i_belong,
46+
Programme.a_level
47+
].compact.sort_by(&:title)
48+
49+
programmes.each do |programme|
50+
expected_link = link_to(programme.title, admin_programme_path(programme.id))
51+
expect(response.body).to include(expected_link)
52+
end
53+
end
3954
end
4055

4156
describe "GET #show" do

0 commit comments

Comments
 (0)