mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
human?
helper method on a user
This is cleaner than hard coding `id > 0` in ruby code.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user