added proper support for hashed_label option, and

disabled it by default
This commit is contained in:
2010-11-22 13:28:19 +00:00
parent 8e3e54a027
commit 8a0e1a47a2
7 changed files with 50 additions and 28 deletions

View File

@@ -15,14 +15,14 @@ describe Redistat::Label do
end
it "should store a label hash lookup key" do
@label.save
@label.saved?.should be_true
db.get("#{Redistat::KEY_LEBELS}#{@label.hash}").should == @name
label = Redistat::Label.new(@name, {:hashed_label => true}).save
label.saved?.should be_true
db.get("#{Redistat::KEY_LEBELS}#{label.hash}").should == @name
@name = "contact_us"
@label = Redistat::Label.create(@name)
@label.saved?.should be_true
db.get("#{Redistat::KEY_LEBELS}#{@label.hash}").should == @name
name = "contact_us"
label = Redistat::Label.create(name, {:hashed_label => true})
label.saved?.should be_true
db.get("#{Redistat::KEY_LEBELS}#{label.hash}").should == name
end
end