FEATURE: custom fields on User

This commit is contained in:
Sam
2014-04-22 13:52:13 +10:00
parent 25860622b7
commit a3b2b4baca
9 changed files with 139 additions and 15 deletions

View File

@ -1149,4 +1149,29 @@ describe User do
end
describe "custom fields" do
it "allows modification of custom fields" do
user = Fabricate(:user)
user.custom_fields["a"].should == nil
user.custom_fields["bob"] = "marley"
user.custom_fields["jack"] = "black"
user.save
user = User.find(user.id)
user.custom_fields["bob"].should == "marley"
user.custom_fields["jack"].should == "black"
user.custom_fields.delete("bob")
user.custom_fields["jack"] = "jill"
user.save
user = User.find(user.id)
user.custom_fields.should == {"jack" => "jill"}
end
end
end