test/rails/caching_test.rb in apotomo-1.2.3 vs test/rails/caching_test.rb in apotomo-1.2.4
- old
+ new
@@ -1,30 +1,30 @@
require 'test_helper'
# TODO: assert that same-named cells and widgets don't overwrite their caches.
-class CachingTest < ActiveSupport::TestCase
+class CachingTest < MiniTest::Spec
include Apotomo::TestCaseMethods::TestController
-
+
class CheeseWidget < Apotomo::Widget
cache :holes
-
+
def holes(count)
render :text => count
- end
+ end
end
-
- context "A caching widget" do
- setup do
+
+ describe "A caching widget" do
+ before do
ActionController::Base.perform_caching = true
@cheese = CheeseWidget.new(parent_controller, 'cheese', :holes)
end
-
- teardown do
+
+ after do
ActionController::Base.perform_caching = false
end
-
- should "invoke the cached state only once" do
+
+ it "invoke the cached state only once" do
assert_equal "1", @cheese.invoke(:holes, 1)
assert_equal "1", @cheese.invoke(:holes, 2)
end
end
end