mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-21 21:57:19 +00:00
Add model spec for Tombstone
(#32697)
This commit is contained in:
parent
917a799c67
commit
a20ac20302
|
@ -14,4 +14,6 @@
|
|||
|
||||
class Tombstone < ApplicationRecord
|
||||
belongs_to :account
|
||||
|
||||
validates :uri, presence: true
|
||||
end
|
||||
|
|
6
spec/fabricators/tombstone_fabricator.rb
Normal file
6
spec/fabricators/tombstone_fabricator.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
Fabricator(:tombstone) do
|
||||
account
|
||||
uri { sequence(:uri) { |i| "https://host.example/value/#{i}" } }
|
||||
end
|
15
spec/models/tombstone_spec.rb
Normal file
15
spec/models/tombstone_spec.rb
Normal 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
|
Loading…
Reference in a new issue