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