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' ...@@ -2,7 +2,7 @@ require 'rails_helper'
RSpec.describe AbuseReport, type: :model do RSpec.describe AbuseReport, type: :model do
subject { create(:abuse_report) } subject { create(:abuse_report) }
let(:user) { create(:user) } let(:user) { create(:admin) }
it { expect(subject).to be_valid } it { expect(subject).to be_valid }
......
...@@ -211,13 +211,15 @@ describe User, models: true do ...@@ -211,13 +211,15 @@ describe User, models: true do
describe 'ghost users' do describe 'ghost users' do
it 'does not allow a non-blocked ghost user' 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 expect(user).to be_invalid
end end
it 'allows a blocked ghost user' do 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 expect(user).to be_valid
end 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