Add CustomFields to Post, Category and Group

This commit is contained in:
Benjamin Kampmann
2014-04-25 15:14:05 +02:00
parent e6e03a1a96
commit 2450088c03
10 changed files with 131 additions and 0 deletions

View File

@ -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') }