mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 15:50:36 -05:00
Shown on Admin -> About, in the software history, records package, procedures and sam:doctor; release notes in the app under Help. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.3 KiB
Ruby
32 lines
1.3 KiB
Ruby
require "test_helper"
|
|
|
|
# Releases: version (YYYY.MM.N, from VERSION) plus build (the commit), and
|
|
# release notes (CHANGELOG.md) as "What's new".
|
|
class VersioningTest < ActionDispatch::IntegrationTest
|
|
test "the version comes from VERSION; About shows version, build and What's new" do
|
|
version = File.read(Rails.root.join("VERSION")).strip
|
|
assert_match(/\A\d{4}\.\d{1,2}\.\d+\z/, version)
|
|
info = SystemInfo.new
|
|
assert_equal version, info.version
|
|
assert_equal "#{version} (build #{info.revision})", info.version_label
|
|
|
|
sign_in create_user("admin@example.com", admin: true)
|
|
get admin_about_path
|
|
assert_select "[data-version]", text: version
|
|
assert_select "[data-revision]", text: /Build/
|
|
assert_select "a[href='#{help_page_path('changelog')}']", text: "What's new"
|
|
|
|
get help_page_path("changelog")
|
|
assert_response :success
|
|
assert_select "h1", text: /What.s new/
|
|
assert_select "h2", text: version # the current version has release notes
|
|
end
|
|
|
|
test "each recorded software build remembers its version" do
|
|
AppRevision.touch_current!
|
|
revision = AppRevision.find_by(revision: SystemInfo.new.revision)
|
|
skip "no git revision in this environment" unless revision
|
|
assert_equal SystemInfo.new.version, revision.version
|
|
end
|
|
end
|