- all catalog services (update/software/highlighted/builds/file/file-manager/ download/image + SoftwareResponseBuilder), the SoftwareUpdater platform services and their concerns, Blueprinter serializers (incl. TimestampFields) and the 4 DTOs now live in the engine under WarpEngine:: - constantize dispatch strings use absolute names (WarpEngine::SoftwareUpdater::<Platform>Service) - container paths read from WarpEngine.config everywhere (FileService, DownloadService, FileManagerService, ArchiveExtraction, ReleaseSerializer path rewriting); FileManagerService base path is now lazy - engine requires blueprinter itself; gemspec declares blueprinter + rubyzip - engine test suite: spec/dummy app (mysql warp_engine_test, catalog-only schema), rails_helper with engine-local factories; catalog model/service specs and factories moved from the host - host suite keeps TTG specs and loads catalog factories from the engine Verified: engine suite 40 green, host suite 14 green, /api/software and /api/builds byte-identical to baselines, admin OK. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
729 B
Ruby
24 lines
729 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe WarpEngine::Release, type: :model do
|
|
it { should belong_to(:software) }
|
|
it { should have_many(:downloads) }
|
|
|
|
describe "version uniqueness" do
|
|
let(:software) { create(:software) }
|
|
|
|
it "prevents duplicate versions for same software" do
|
|
create(:release, software: software, version: "1.0.0")
|
|
dup = build(:release, software: software, version: "1.0.0")
|
|
expect(dup).not_to be_valid
|
|
end
|
|
|
|
it "allows same version across different software" do
|
|
other_sw = create(:software)
|
|
create(:release, software: software, version: "1.0.0")
|
|
other = build(:release, software: other_sw, version: "1.0.0")
|
|
expect(other).to be_valid
|
|
end
|
|
end
|
|
end
|