spec/spec_app/app/controllers/instances.rb in praxis-0.15.0 vs spec/spec_app/app/controllers/instances.rb in praxis-0.16.0

- old
+ new

@@ -1,11 +1,11 @@ class Instances < BaseClass include Praxis::Controller implements ApiResources::Instances include Concerns::BasicApi - + before :validate, actions: [:index] do |controller| #p [:before, :validate, :params_and_headers, controller.request.action.name] end before actions: [:show] do |controller| @@ -30,11 +30,11 @@ around :action, actions: [:show] do |controller, blk| #puts "Decorator two (show action) start" blk.call #puts "Decorator two end" end - + around :action, actions: [:index] do |controller, blk| #puts "Decorator three (index action) start" blk.call #puts "Decorator three end" end @@ -102,6 +102,10 @@ response.body = JSON.pretty_generate(request.payload.dump) response.headers['Content-Type'] = 'application/vnd.acme.instance' response end + def exceptional(cloud_id:, splat:) + response.headers['Content-Type'] = 'application/vnd.acme.instance' + response + end end