In my config/routes.rb, I have created a specific route targeting the data controller:
match '/things/:id/data' => 'data#get', :via => :get
When I set up a functional test, I got the following error:
ActionController::RoutingError: No route matches {:controller=>"data", :action=>"get"}
My test is:
require 'test_helper'
class ActionController::TestCase
include Devise::TestHelpers
end
class DataControllerTest < ActionController::TestCase
setup do
sign_in users(:one)
end
test "should get last data of thing" do
get :get
assert_response :success
end
end
How can I specify in the test that /things/:id/data needs to be used to match data#get ?