mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
25 lines
579 B
Ruby
25 lines
579 B
Ruby
|
|
require 'rails_helper'
|
||
|
|
|
||
|
|
RSpec.describe PostStatusChange, type: :model do
|
||
|
|
let(:post_status_change) { FactoryBot.build(:post_status_change) }
|
||
|
|
|
||
|
|
it 'should be valid' do
|
||
|
|
expect(post_status_change).to be_valid
|
||
|
|
end
|
||
|
|
|
||
|
|
it 'must have a post' do
|
||
|
|
post_status_change.post = nil
|
||
|
|
expect(post_status_change).to be_invalid
|
||
|
|
end
|
||
|
|
|
||
|
|
it 'must have a user' do
|
||
|
|
post_status_change.user = nil
|
||
|
|
expect(post_status_change).to be_invalid
|
||
|
|
end
|
||
|
|
|
||
|
|
it 'can have a null post status' do
|
||
|
|
post_status_change.post_status = nil
|
||
|
|
expect(post_status_change).to be_valid
|
||
|
|
end
|
||
|
|
end
|