spec/spec_helper.rb in grape-app-0.8.2 vs spec/spec_helper.rb in grape-app-0.8.3
- old
+ new
@@ -37,10 +37,11 @@
helpers Grape::App::Helpers::Caching
helpers Grape::App::Helpers::Params
get '/articles' do
scope = Article.all
- fresh_when(scope, public: true)
+ opts = params[:public] ? { public: params[:public] } : {}
+ fresh_when(scope, **opts)
scope.map(&:to_hash)
end
get '/articles/:id' do
article = Article.all.first