lundi 6 avril 2015

test rails 3, ruby 1.8.7's method

i want to test a method created to returns data:


Routes.rb



resources :foos do
member do
get "method"
end
end


controller.rb



class FoosController < ApplicationController
def method(var)
instance = One::Two::Instance.new
get = instance.get var #var is a string
end


i don't know how to proceed, test or anything from here. i've seen one testing by sending params through the address bar of the browser, i don't have a view for this mehod(is it necessary?). i don't know how to send params from the form either.


thx for your attention


Aucun commentaire:

Enregistrer un commentaire