Testing MessageDB Database Provisioning in Postal Server
This test suite validates the core functionality of the MessageDB Database component in the Postal server application, focusing on database provisioning and schema management. The tests ensure proper instantiation and version control of the message database system.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
postalserver/postal
spec/lib/postal/message_db/database_spec.rb
# frozen_string_literal: true
require "rails_helper"
describe Postal::MessageDB::Database do
context "when provisioned" do
let(:server) { create(:server) }
subject(:database) { server.message_db }
it "should be a message db" do
expect(database).to be_a Postal::MessageDB::Database
end
it "should return the current schema version" do
expect(database.schema_version).to be_a Integer
end
end
end