title: How to request (GET/POST) routes in RSpec that have a wildcard
body: <p>I have this (admittedly hideous) route in Rails:</p>
  
  <pre>
  scope '/software' do
    post '/:software_id/:attachment_id/event/*event' => 'software#post_event', as: 'post_event'
  end
  </pre>
  
  <p>(I would change it but for a legacy API)</p>
  
  <p>And I am writing an RSpec test for it.</p>
  
  <p><code>rake routes</code> gives me:</p>
  
  <pre>
  post_event POST   /software/:software_id/:attachment_id/event/*event(.:format)     api/version1301/software#post_event
  </pre>
  
  <p>My test looks like this:</p>
  
  <pre>
    describe "post_event" do
  
      it "should respond with 204" do
        params = {
          attachment_id: @attachment.uid,
          software_id: @license.id
        }
  
        post :post_event, params
  
        response.code.should eq "204"
      end
    end
  </pre>
  
  <p>But I get the following routing error:</p>
  
  <pre>
  Failure/Error: post :post_event, params
  ActionController::RoutingError:
  No route matches {:format=>"json", :name_path=>:api, :attachment=>"7b40ab6a-d522-4a86-b0de-dfb8081e4465", :software_id=>"0000001", :attachment_id=>"7b40ab6a-d522-4a86-b0de-dfb8081e4465", :controller=>"api/version1301/software", :action=>"post_event"}
       # ./spec/controllers/api/version1301/software_controller_spec.rb:62:in `block (4 levels) in '
  </pre>
  
  <p>How do you handle the route with the wildcard (event)?</p>