Skip to content

Commit

Permalink
Add specs for ToC titles
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Oct 24, 2024
1 parent ce26ae4 commit e4aa94c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/system/toc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
scenario "index" do
visit toc_index_path

expect(page.title).to eq("Table of Contents - The Journal of Open Source Software")

within("#toc-header") do
expect(page).to have_content("Table of Contents")
expect(page).to_not have_link("Table of Contents")
Expand All @@ -64,6 +66,9 @@

scenario "by year" do
visit toc_year_path(year: @years.first)

expect(page.title).to eq("#{@years.first} - The Journal of Open Source Software")

within("#toc-header") do
expect(page).to have_content("Year #{@years.first}")
expect(page).to have_link("Table of Contents")
Expand All @@ -84,6 +89,9 @@

scenario "by volume" do
visit toc_volume_path(volume: 1)

expect(page.title).to eq("Volume 1 - The Journal of Open Source Software")

within("#toc-header") do
expect(page).to have_content("Year #{@years.first}")
expect(page).to have_content("Volume 1")
Expand All @@ -94,6 +102,9 @@
expect(page).to_not have_link(@last_accepted_paper.title)

visit toc_volume_path(volume: @volumes.last)

expect(page.title).to eq("Volume #{@volumes.last} - The Journal of Open Source Software")

within("#toc-header") do
expect(page).to have_content("Year #{@years.last}")
expect(page).to have_content("Volume #{@volumes.last}")
Expand All @@ -106,6 +117,9 @@

scenario "by issue" do
visit toc_issue_path(issue: 1)

expect(page.title).to eq("Issue 1 - The Journal of Open Source Software")

within("#toc-header") do
expect(page).to have_content("#{Date::MONTHNAMES[@launch_month]} #{@years.first} Volume 1")
expect(page).to have_content("Issue 1")
Expand All @@ -116,6 +130,9 @@
expect(page).to_not have_link(@last_accepted_paper.title)

visit toc_issue_path(issue: @issues.last)

expect(page.title).to eq("Issue #{@issues.last} - The Journal of Open Source Software")

within("#toc-header") do
expect(page).to have_content("#{Date::MONTHNAMES[@now.month]} #{@years.last} Volume #{@volumes.last}")
expect(page).to have_content("Issue #{@issues.last}")
Expand Down

0 comments on commit e4aa94c

Please sign in to comment.