Skip to content

Commit 392887a

Browse files
committed
added first test for the PostType model
1 parent 3f558f9 commit 392887a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/models/category.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def update_activity(last_activity)
4444

4545
# Gets categories appropriately scoped for a given user
4646
# @param user [User] user to check
47-
# @return [ActiveRecord::Relation<category>]
47+
# @return [ActiveRecord::Relation<Category>]
4848
def self.accessible_to(user)
4949
if user&.at_least_moderator?
5050
return Category.all

test/models/post_type_test.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'test_helper'
2+
3+
class PostTypeTest < ActiveSupport::TestCase
4+
test 'system? should correctly determine if a type is a system type' do
5+
assert_not post_types(:question).system?
6+
assert post_types(:policy_doc).system?
7+
assert post_types(:help_doc).system?
8+
end
9+
end

0 commit comments

Comments
 (0)