mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
fix most deprecations in the specs (still some left)
This commit is contained in:
@ -13,15 +13,15 @@ describe Middleware::AnonymousCache::Helper do
|
||||
|
||||
context "cachable?" do
|
||||
it "true by default" do
|
||||
new_helper.cacheable?.should be_true
|
||||
new_helper.cacheable?.should == true
|
||||
end
|
||||
|
||||
it "is false for non GET" do
|
||||
new_helper("ANON_CACHE_DURATION" => 10, "REQUEST_METHOD" => "POST").cacheable?.should be_false
|
||||
new_helper("ANON_CACHE_DURATION" => 10, "REQUEST_METHOD" => "POST").cacheable?.should == false
|
||||
end
|
||||
|
||||
it "is false if it has an auth cookie" do
|
||||
new_helper("HTTP_COOKIE" => "jack=1; _t=#{"1"*32}; jill=2").cacheable?.should be_false
|
||||
new_helper("HTTP_COOKIE" => "jack=1; _t=#{"1"*32}; jill=2").cacheable?.should == false
|
||||
end
|
||||
end
|
||||
|
||||
@ -41,14 +41,14 @@ describe Middleware::AnonymousCache::Helper do
|
||||
|
||||
it "returns cached data for cached requests" do
|
||||
helper.is_mobile = true
|
||||
helper.cached.should be_nil
|
||||
helper.cached.should == nil
|
||||
helper.cache([200, {"HELLO" => "WORLD"}, ["hello ", "my world"]])
|
||||
|
||||
helper = new_helper("ANON_CACHE_DURATION" => 10)
|
||||
helper.is_mobile = true
|
||||
helper.cached.should == [200, {"HELLO" => "WORLD"}, ["hello my world"]]
|
||||
|
||||
crawler.cached.should be_nil
|
||||
crawler.cached.should == nil
|
||||
crawler.cache([200, {"HELLO" => "WORLD"}, ["hello ", "world"]])
|
||||
crawler.cached.should == [200, {"HELLO" => "WORLD"}, ["hello world"]]
|
||||
end
|
||||
|
Reference in New Issue
Block a user