mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Versions: year.month.release (VERSION) plus build (commit); What's new from CHANGELOG.md
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>
This commit is contained in:
1 parent
98e943cf0a
commit
8c8e3b7374
16 files changed
+110
-19
No files matched your search
@@ -0,0 +1,31 @@
|
||||
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
|
||||
Reference in new issue
Block a user