human? helper method on a user

This is cleaner than hard coding `id > 0` in ruby code.
This commit is contained in:
Robin Ward
2019-02-08 13:34:54 -05:00
parent fb18c57372
commit c719658f9f
5 changed files with 17 additions and 3 deletions

View File

@ -1989,4 +1989,14 @@ describe User do
expect(PostAction.with_deleted.where(user_id: user.id).length).to eq(0)
end
end
context "human?" do
it "returns true for a regular user" do
expect(Fabricate(:user)).to be_human
end
it "returns false for the system user" do
expect(Discourse.system_user).not_to be_human
end
end
end