1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-27 06:18:53 +09:00

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
belongs_to :account
validates :uri, presence: true
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