routing – Tea-Driven Development https://blog.mattwynne.net Matt Wynne taking it one tea at a time Wed, 21 Aug 2019 13:05:19 +0000 en-US hourly 1 https://wordpress.org/?v=6.2 165828820 Behaviour-Driving Routes in Rails with RSpec https://blog.mattwynne.net/2008/08/08/behaviour-driving-routes-in-rails-with-rspec/ https://blog.mattwynne.net/2008/08/08/behaviour-driving-routes-in-rails-with-rspec/#respond Fri, 08 Aug 2008 16:46:10 +0000 http://blog.mattwynne.net/2008/08/08/behaviour-driving-routes-in-rails-with-rspec/ Continue reading "Behaviour-Driving Routes in Rails with RSpec"

]]>
One thing that isn’t documented very well for RSpec is how to test your routes.

I came across an old post on the rspec mailing list which described a great way to do this:

describe TasksController "routing" do

    it "should route POST request for /tasks to the 'create' action" do
        params_from(:post, "/tasks").should == {:controller =>; "tasks", :action =>; "create"}
    end

end

Very nice.

]]>
https://blog.mattwynne.net/2008/08/08/behaviour-driving-routes-in-rails-with-rspec/feed/ 0 72