Searched through other similar questions on here, and they all seem to be related to a malformed request of some sort (Not providing an id, or not including the params correctly) but those don't seem to be the problem I'm having.
The route definitely exists, going to the route in the browser works just fine. Page loads, everything. But Rspec is giving me a UrlGenerationError for some reason.
I've tried manually specifying the controller name in the routes, changing to a pluralized controller, and even using a different (pluralized) controller. It's seeming like there is an issue with some other configuration somewhere, but the error that it's a URLGeneration error is extremely unhelpful. I would greatly appreciate any other ideas.
We have API controller specs elsewhere in our app that seem to be functioning correctly, but I cannot tell the difference in set up between those and this one.
My error:
1) Spaceman::ReputationEnhancementsController GET show has a 200 status code
Failure/Error: get :show
ActionController::UrlGenerationError:
No route matches {:action=>"show", :controller=>"spaceman/reputation_enhancements"}
# ./spec/controllers/spaceman/reputation_enhancements_controller_spec.rb:10:in `block (3 levels) in <top (required)>'
Finished in 1.14 seconds (files took 6.13 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/controllers/spaceman/reputation_enhancements_controller_spec.rb:9 # Spaceman::ReputationEnhancementsController GET show has a 200 status code
Routes:
Spaceman::Engine.routes.draw do
resource :reputation_enhancement, path: "reputation-enhancement", only: [ :show, :create ] do
get :filter
end
end
Test: (I've tried added type: :controller here, as well as fully qualifying, adding Rspec.describe instead, etc...)
require "rails_helper"
describe Spaceman::ReputationEnhancementsController do
describe "GET show" do
it "has a 200 status code" do
get :show
expect(response.status).to eq(200)
end
end
end
rake routes
filter_reputation_enhancement GET /reputation-enhancement/filter(.:format) spaceman/reputation_enhancements#filter
reputation_enhancement GET /reputation-enhancement(.:format) spaceman/reputation_enhancements#show
POST /reputation-enhancement(.:format) spaceman/reputation_enhancements#create
EDIT:
I've tried manually specifying the controller name in the routes, changing to a pluralized controller, and even using a different (pluralized) controller. It's seeming like there is an issue with some other configuration somewhere, but the error that it's a URLGeneration error is extremely unhelpful. I would greatly appreciate any other ideas.