ruby - No route matches when using Rack application with Rails and Rspc -
i've been having issues controller spec since moving code rack application within rails code. routes work when running server, not via rspec.
this route definition:
match ':username', to: rack::catchallrouter.new, constraints: { format: 'html' }, via: [:get, :put, :patch]
the following code controller spec:
describe userscontroller describe "#show" subject { :show, username: 'test-user' } { is_expected.to be_successful } { is_expected.to render_template('users/show') } end end
the error receive follows:
no route matches {:action=>"show", :controller=>"users", :username=>"test-user"}
i don't understand why should have go through router @ should testing controller rather going through whole request setup.
i'm able working via request spec , constructing url, not controller spec.
probably params in route doesn't match params send in spec
Comments
Post a Comment