Fix specs for the ghost user feature.

This commit is contained in:
Timothy Andrew 2017-02-21 12:50:05 +05:30
parent 6fdb17cbbe
commit 53aa043724
No known key found for this signature in database
GPG Key ID: ADC2E3B686F331DB
2 changed files with 5 additions and 3 deletions

View File

@ -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 }

View File

@ -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