Sha256: dd597ec2d39e9c441fd693784e0a9fc1103b04b750abbfdafd11babc6b845682

Contents?: true

Size: 576 Bytes

Versions: 10

Compression:

Stored size: 576 Bytes

Contents

module ControllerHacks
  extend ActiveSupport::Concern

  included do
    routes { Spree::Core::Engine.routes }
  end

  def api_get(action, params={}, session=nil, flash=nil)
    api_process(action, params, session, flash, "GET")
  end

  def api_process(action, params={}, session=nil, flash=nil, method="get")
    scoping = respond_to?(:resource_scoping) ? resource_scoping : {}
    process(action, method, params.merge(scoping).reverse_merge!(:format => :json), session, flash)
  end
end

RSpec.configure do |config|
  config.include ControllerHacks, type: :controller
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_zaez_cielo-3.0.10 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.9 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.8 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.7 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.6 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.5 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.4 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.3 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.2 spec/support/controller_hacks.rb
spree_zaez_cielo-3.0.1 spec/support/controller_hacks.rb