Module: Spree::TestingSupport::ControllerRequests

Defined in:
lib/spree/testing_support/controller_requests.rb

Instance Method Summary collapse

Instance Method Details

#spree_delete(action, parameters = nil, session = nil, flash = nil) ⇒ Object

Executes a request simulating DELETE HTTP method and set/volley the response



44
45
46
# File 'lib/spree/testing_support/controller_requests.rb', line 44

def spree_delete(action, parameters = nil, session = nil, flash = nil)
  process_spree_action(action, parameters, session, flash, "DELETE")
end

#spree_get(action, parameters = nil, session = nil, flash = nil) ⇒ Object



29
30
31
# File 'lib/spree/testing_support/controller_requests.rb', line 29

def spree_get(action, parameters = nil, session = nil, flash = nil)
  process_spree_action(action, parameters, session, flash, "GET")
end

#spree_post(action, parameters = nil, session = nil, flash = nil) ⇒ Object

Executes a request simulating POST HTTP method and set/volley the response



34
35
36
# File 'lib/spree/testing_support/controller_requests.rb', line 34

def spree_post(action, parameters = nil, session = nil, flash = nil)
  process_spree_action(action, parameters, session, flash, "POST")
end

#spree_put(action, parameters = nil, session = nil, flash = nil) ⇒ Object

Executes a request simulating PUT HTTP method and set/volley the response



39
40
41
# File 'lib/spree/testing_support/controller_requests.rb', line 39

def spree_put(action, parameters = nil, session = nil, flash = nil)
  process_spree_action(action, parameters, session, flash, "PUT")
end

#spree_xhr_delete(action, parameters = nil, session = nil, flash = nil) ⇒ Object



60
61
62
# File 'lib/spree/testing_support/controller_requests.rb', line 60

def spree_xhr_delete(action, parameters = nil, session = nil, flash = nil)
  process_spree_xhr_action(action, parameters, session, flash, :delete)
end

#spree_xhr_get(action, parameters = nil, session = nil, flash = nil) ⇒ Object



48
49
50
# File 'lib/spree/testing_support/controller_requests.rb', line 48

def spree_xhr_get(action, parameters = nil, session = nil, flash = nil)
  process_spree_xhr_action(action, parameters, session, flash, :get)
end

#spree_xhr_post(action, parameters = nil, session = nil, flash = nil) ⇒ Object



52
53
54
# File 'lib/spree/testing_support/controller_requests.rb', line 52

def spree_xhr_post(action, parameters = nil, session = nil, flash = nil)
  process_spree_xhr_action(action, parameters, session, flash, :post)
end

#spree_xhr_put(action, parameters = nil, session = nil, flash = nil) ⇒ Object



56
57
58
# File 'lib/spree/testing_support/controller_requests.rb', line 56

def spree_xhr_put(action, parameters = nil, session = nil, flash = nil)
  process_spree_xhr_action(action, parameters, session, flash, :put)
end