mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
PERF: stop using jQuery to sanitize strings
This commit is contained in:
parent
6b7c1011fd
commit
e20e6b4524
5 changed files with 23 additions and 17 deletions
|
@ -19,14 +19,6 @@ describe Category do
|
|||
c.errors[:name].should be_present
|
||||
end
|
||||
|
||||
it { should belong_to :topic }
|
||||
it { should belong_to :user }
|
||||
|
||||
it { should have_many :topics }
|
||||
it { should have_many :category_featured_topics }
|
||||
it { should have_many :featured_topics }
|
||||
it { should belong_to :parent_category}
|
||||
|
||||
describe "last_updated_at" do
|
||||
it "returns a number value of when the category was last updated" do
|
||||
last = Category.last_updated_at
|
||||
|
@ -49,7 +41,7 @@ describe Category do
|
|||
|
||||
# NOTE we also have the uncategorized category ... hence the increased count
|
||||
|
||||
default_category = Fabricate(:category)
|
||||
_default_category = Fabricate(:category)
|
||||
full_category = Fabricate(:category)
|
||||
can_post_category = Fabricate(:category)
|
||||
can_read_category = Fabricate(:category)
|
||||
|
@ -194,6 +186,15 @@ describe Category do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'description_text' do
|
||||
it 'correctly generates text description as needed' do
|
||||
c = Category.new
|
||||
c.description_text.should == nil
|
||||
c.description = "<hello <a>test</a>."
|
||||
c.description_text.should == "<hello test."
|
||||
end
|
||||
end
|
||||
|
||||
describe 'after create' do
|
||||
before do
|
||||
@category = Fabricate(:category, name: 'Amazing Category')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue