Fix specs for the ghost user feature.
This commit is contained in:
parent
6fdb17cbbe
commit
53aa043724
|
|
@ -2,7 +2,7 @@ require 'rails_helper'
|
|||
|
||||
RSpec.describe AbuseReport, type: :model do
|
||||
subject { create(:abuse_report) }
|
||||
let(:user) { create(:user) }
|
||||
let(:user) { create(:admin) }
|
||||
|
||||
it { expect(subject).to be_valid }
|
||||
|
||||
|
|
|
|||
|
|
@ -211,13 +211,15 @@ describe User, models: true do
|
|||
|
||||
describe 'ghost users' do
|
||||
it 'does not allow a non-blocked ghost user' do
|
||||
user = build(:user, :ghost, state: :active)
|
||||
user = build(:user, :ghost)
|
||||
user.state = 'active'
|
||||
|
||||
expect(user).to be_invalid
|
||||
end
|
||||
|
||||
it 'allows a blocked ghost user' do
|
||||
user = build(:user, :ghost, state: :blocked)
|
||||
user = build(:user, :ghost)
|
||||
user.state = 'blocked'
|
||||
|
||||
expect(user).to be_valid
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue