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:
parent
415472ca95
commit
8d980ea61e
4 changed files with 7 additions and 7 deletions
|
@ -4,8 +4,8 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe Block do
|
||||
describe 'validations' do
|
||||
it { is_expected.to belong_to(:account) }
|
||||
it { is_expected.to belong_to(:target_account) }
|
||||
it { is_expected.to belong_to(:account).required }
|
||||
it { is_expected.to belong_to(:target_account).required }
|
||||
end
|
||||
|
||||
it 'removes blocking cache after creation' do
|
||||
|
|
|
@ -9,8 +9,8 @@ RSpec.describe Follow do
|
|||
describe 'validations' do
|
||||
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(:target_account) }
|
||||
it { is_expected.to belong_to(:account).required }
|
||||
it { is_expected.to belong_to(:target_account).required }
|
||||
|
||||
it 'is invalid if account already follows too many people' do
|
||||
alice.update(following_count: FollowLimitValidator::LIMIT)
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe Mention do
|
||||
describe 'validations' do
|
||||
it { is_expected.to belong_to(:account) }
|
||||
it { is_expected.to belong_to(:status) }
|
||||
it { is_expected.to belong_to(:account).required }
|
||||
it { is_expected.to belong_to(:status).required }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ RSpec.describe User do
|
|||
end
|
||||
|
||||
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
|
||||
user = Fabricate.build(:user, email: 'john@')
|
||||
|
|
Loading…
Reference in a new issue