I have a route defined as :

change_area_backoffice_regions GET  /backoffice/regions/
change_area(.:format)     backoffice/regions#change_area

I am testing  using the following functional test :


  test "should list regions in another area" do
    south_west = FactoryGirl.create(:area, name: "South West)
    new_mexico = FactoryGirl.create(:region, area: south_west, code:
"72")
# here is my call
    xhr :get, :change_area => { :area => south_west[:id]}
# sending the area[:id] as a parameter
    assert_select "a", {:count => 1, :text => "New Mexico"}, "Wrong
name or more than one region element"
  end

but I get a route error :
AbstractController::ActionNotFound: The action
'{:change_area=>{:area=>20}}' could not be found for
Backoffice::RegionsController
this action is defined , and the route is there , what's wrong with y
test code ?

  def change_area
    @area = Area.find(params[:area])
    @regions = @area.regions
    render "backoffice/regions/change_area.js"
  end

thanks for any feedback

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to