Add model spec for Tombstone (#32697)

This commit is contained in:
Matt Jankowski 2024-10-31 09:27:47 -04:00 committed by GitHub
parent 917a799c67
commit a20ac20302
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 0 deletions

View file

@ -14,4 +14,6 @@
class Tombstone < ApplicationRecord class Tombstone < ApplicationRecord
belongs_to :account belongs_to :account
validates :uri, presence: true
end end

View file

@ -0,0 +1,6 @@
# frozen_string_literal: true
Fabricator(:tombstone) do
account
uri { sequence(:uri) { |i| "https://host.example/value/#{i}" } }
end

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe Tombstone do
describe 'Associations' do
it { is_expected.to belong_to(:account).required }
end
describe 'Validations' do
subject { Fabricate.build :tombstone }
it { is_expected.to validate_presence_of(:uri) }
end
end