spec/shellac_spec.rb in shellac-0.0.2.4 vs spec/shellac_spec.rb in shellac-0.0.3.rc2
- old
+ new
@@ -12,20 +12,29 @@
context "(rails performs caching)" do
before(:each) do
ActionController::Base.perform_caching = true
end
- it "should raise error if varnish is not available" do
- lambda {ActionController::Base.purge("/")}.should raise_error(Errno::ECONNREFUSED)
- end
+ pending "should raise error if varnish is not available"
end
context "(rails doesn't perform caching)" do
before(:each) do
ActionController::Base.perform_caching = false
end
it "should return nil" do
ActionController::Base.purge("/").should be nil
+ end
+ end
+
+ context "(purge multiple hosts)" do
+ before(:each) do
+ ActionController::Base.perform_caching = true
+ end
+
+ it "should purge more than one hosts" do
+ Varnish::Client.any_instance.should_receive(:purge).with("req.http.host ~ ^(mobile.bitflut.com|bitflut.com) && req.url ~ ^/$")
+ ActionController::Base.purge("/", false, ["mobile.bitflut.com", "bitflut.com"])
end
end
end
\ No newline at end of file