I am trying to test the method that I have in my application, but I do not know how the unit test method, which is protected from fake, look at this:
def index
@alumnos = Alumno.paginate :per_page => 20,
:page => params[:page], :order => :nombre
respond_to do |format|
format.html
format.xml { render :xml => @alumnos }
end
end
In index.html.erb, I have this line:
<%= javascript_tag "window._token = '#{form_authenticity_token}'" %>
So, when I try to test it with a functional test, it seems that the session does not have secret work that will lead to the test failing, can anyone try these methods?
source
share