1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Add required to belongs to check

This commit is contained in:
Matt Jankowski 2024-06-18 10:11:56 -04:00
parent 6b51f4c10b
commit b33aa09787
4 changed files with 7 additions and 7 deletions

View file

@ -4,8 +4,8 @@ require 'rails_helper'
RSpec.describe Block do RSpec.describe Block do
describe 'validations' do describe 'validations' do
it { is_expected.to belong_to(:account) } it { is_expected.to belong_to(:account).required }
it { is_expected.to belong_to(:target_account) } it { is_expected.to belong_to(:target_account).required }
end end
it 'removes blocking cache after creation' do it 'removes blocking cache after creation' do

View file

@ -9,8 +9,8 @@ RSpec.describe Follow do
describe 'validations' do describe 'validations' do
subject { described_class.new(account: alice, target_account: bob, rate_limit: true) } subject { described_class.new(account: alice, target_account: bob, rate_limit: true) }
it { is_expected.to belong_to(:account) } it { is_expected.to belong_to(:account).required }
it { is_expected.to belong_to(:target_account) } it { is_expected.to belong_to(:target_account).required }
it 'is invalid if account already follows too many people' do it 'is invalid if account already follows too many people' do
alice.update(following_count: FollowLimitValidator::LIMIT) alice.update(following_count: FollowLimitValidator::LIMIT)

View file

@ -4,7 +4,7 @@ require 'rails_helper'
RSpec.describe Mention do RSpec.describe Mention do
describe 'validations' do describe 'validations' do
it { is_expected.to belong_to(:account) } it { is_expected.to belong_to(:account).required }
it { is_expected.to belong_to(:status) } it { is_expected.to belong_to(:status).required }
end end
end end

View file

@ -32,7 +32,7 @@ RSpec.describe User do
end end
describe 'validations' do describe 'validations' do
it { is_expected.to belong_to(:account) } it { is_expected.to belong_to(:account).required }
it 'is invalid without a valid email' do it 'is invalid without a valid email' do
user = Fabricate.build(:user, email: 'john@') user = Fabricate.build(:user, email: 'john@')