mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 02:44:58 +08:00
Add CustomFields to Post, Category and Group
This commit is contained in:
@ -133,6 +133,18 @@ describe Category do
|
||||
Fabricate(:category, name: " blanks ").name.should == "blanks"
|
||||
end
|
||||
|
||||
it "has custom fields" do
|
||||
category = Fabricate(:category, name: " music")
|
||||
category.custom_fields["a"].should == nil
|
||||
|
||||
category.custom_fields["bob"] = "marley"
|
||||
category.custom_fields["jack"] = "black"
|
||||
category.save
|
||||
|
||||
category = Category.find(category.id)
|
||||
category.custom_fields.should == {"bob" => "marley", "jack" => "black"}
|
||||
end
|
||||
|
||||
describe "short name" do
|
||||
let!(:category) { Fabricate(:category, name: 'xx') }
|
||||
|
||||
|
Reference in New Issue
Block a user