Add model spec for `Tombstone` (#32697)
parent
917a799c67
commit
a20ac20302
|
@ -14,4 +14,6 @@
|
|||
|
||||
class Tombstone < ApplicationRecord
|
||||
belongs_to :account
|
||||
|
||||
validates :uri, presence: true
|
||||
end
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:tombstone) do
|
||||
account
|
||||
uri { sequence(:uri) { |i| "https://host.example/value/#{i}" } }
|
||||
end
|
|
@ -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
|
Loading…
Reference in New Issue