| 1 | # frozen_string_literal: true |
| 2 | |
| 3 | require "rails_helper" |
| 4 | |
| 5 | # The application layout footer shows the current release version, sourced from |
| 6 | # the single `Sigitsi::VERSION` constant so a release bump updates the site. |
| 7 | RSpec.describe "Footer version", type: :request do |
| 8 | it "renders the semantic version from Sigitsi::VERSION" do |
| 9 | get "/" |
| 10 | |
| 11 | expect(response).to have_http_status(:ok) |
| 12 | expect(response.body).to include("v#{Sigitsi::VERSION}") |
| 13 | end |
| 14 | |
| 15 | it "links the version to its changelog page" do |
| 16 | get "/" |
| 17 | |
| 18 | expect(response.body).to include("/changelog/v#{Sigitsi::VERSION}") |
| 19 | end |
| 20 | |
| 21 | it "exposes a valid semantic version string" do |
| 22 | expect(Sigitsi::VERSION).to match(/\A\d+\.\d+\.\d+\z/) |
| 23 | end |
| 24 | end |