Commit 53aa0437 authored by Timothy Andrew's avatar Timothy Andrew

Fix specs for the ghost user feature.

parent 6fdb17cb
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment