Add CustomFields to Post, Category and Group

This commit is contained in:
Benjamin Kampmann
2014-04-29 19:26:42 +02:00
parent e6e03a1a96
commit 2450088c03
10 changed files with 131 additions and 0 deletions
+13
View File
@@ -148,6 +148,19 @@ describe Group do
GroupUser.count.should == original_count
end
it "has custom fields" do
group = Fabricate(:group)
group.custom_fields["a"].should == nil
group.custom_fields["hugh"] = "jackman"
group.custom_fields["jack"] = "black"
group.save
group = Group.find(group.id)
group.custom_fields.should == {"hugh" => "jackman", "jack" => "black"}
end
it "allows you to lookup a new group by name" do
group = Fabricate(:group)
group.id.should == Group[group.name].id