spec/spec_app/app/controllers/instances.rb in praxis-0.10.1 vs spec/spec_app/app/controllers/instances.rb in praxis-0.11pre

- old
+ new

@@ -18,20 +18,23 @@ around :validate, actions: [:show] do |controller, blk| #puts "Before validate decorator (for show)" blk.call #puts "After validate decorator" end + around :action do |controller, blk| #puts "Decorator one (all actions) start" blk.call #puts "Decorator one end" end + 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 @@ -83,7 +86,16 @@ response.body = JSON.pretty_generate(result) response end + def terminate(id:, cloud_id:) + response.headers['Content-Type'] = 'application/json' + response + end + + def stop(id:, cloud_id:) + response.headers['Content-Type'] = 'application/json' + response + end end