Skip to content

Commit e4aa94c

Browse files
committed
Add specs for ToC titles
1 parent ce26ae4 commit e4aa94c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/system/toc_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
scenario "index" do
4747
visit toc_index_path
4848

49+
expect(page.title).to eq("Table of Contents - The Journal of Open Source Software")
50+
4951
within("#toc-header") do
5052
expect(page).to have_content("Table of Contents")
5153
expect(page).to_not have_link("Table of Contents")
@@ -64,6 +66,9 @@
6466

6567
scenario "by year" do
6668
visit toc_year_path(year: @years.first)
69+
70+
expect(page.title).to eq("#{@years.first} - The Journal of Open Source Software")
71+
6772
within("#toc-header") do
6873
expect(page).to have_content("Year #{@years.first}")
6974
expect(page).to have_link("Table of Contents")
@@ -84,6 +89,9 @@
8489

8590
scenario "by volume" do
8691
visit toc_volume_path(volume: 1)
92+
93+
expect(page.title).to eq("Volume 1 - The Journal of Open Source Software")
94+
8795
within("#toc-header") do
8896
expect(page).to have_content("Year #{@years.first}")
8997
expect(page).to have_content("Volume 1")
@@ -94,6 +102,9 @@
94102
expect(page).to_not have_link(@last_accepted_paper.title)
95103

96104
visit toc_volume_path(volume: @volumes.last)
105+
106+
expect(page.title).to eq("Volume #{@volumes.last} - The Journal of Open Source Software")
107+
97108
within("#toc-header") do
98109
expect(page).to have_content("Year #{@years.last}")
99110
expect(page).to have_content("Volume #{@volumes.last}")
@@ -106,6 +117,9 @@
106117

107118
scenario "by issue" do
108119
visit toc_issue_path(issue: 1)
120+
121+
expect(page.title).to eq("Issue 1 - The Journal of Open Source Software")
122+
109123
within("#toc-header") do
110124
expect(page).to have_content("#{Date::MONTHNAMES[@launch_month]} #{@years.first} Volume 1")
111125
expect(page).to have_content("Issue 1")
@@ -116,6 +130,9 @@
116130
expect(page).to_not have_link(@last_accepted_paper.title)
117131

118132
visit toc_issue_path(issue: @issues.last)
133+
134+
expect(page.title).to eq("Issue #{@issues.last} - The Journal of Open Source Software")
135+
119136
within("#toc-header") do
120137
expect(page).to have_content("#{Date::MONTHNAMES[@now.month]} #{@years.last} Volume #{@volumes.last}")
121138
expect(page).to have_content("Issue #{@issues.last}")

0 commit comments

Comments
 (0)