spec/controllers/apipies_controller_spec.rb in apipie-rails-0.0.17 vs spec/controllers/apipies_controller_spec.rb in apipie-rails-0.0.18
- old
+ new
@@ -108,13 +108,16 @@
File.open(File.join(cache_dir, "apidoc", "v1", "resource.html"), "w") { |f| f << "resource.html cache" }
File.open(File.join(cache_dir, "apidoc", "v1", "resource", "method.html"), "w") { |f| f << "method.html cache" }
Apipie.configuration.use_cache = true
Apipie.configuration.cache_dir = cache_dir
+ @orig_version = Apipie.configuration.default_version
Apipie.configuration.default_version = 'v1'
end
after do
+ Apipie.configuration.use_cache = false
+ Apipie.configuration.default_version = @orig_version
# FileUtils.rm_r(cache_dir) if File.exists?(cache_dir)
end
it "uses the file in cache dir instead of generating the content on runtime" do
get :index