Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created June 6, 2010 02:20
Show Gist options
  • Save dchelimsky/427195 to your computer and use it in GitHub Desktop.
Save dchelimsky/427195 to your computer and use it in GitHub Desktop.
Foo::Application.routes.draw do |map|
match '/:id', :to => 'users#profile', :as => :profile, :via => 'get'
end
$ rspec spec -cfd
UsersController
profile
renders the profile url
class UsersController < ApplicationController
def profile
render :text => profile_url("foo")
end
end
require 'spec_helper'
describe UsersController do
describe 'profile' do
it 'renders the profile url' do
get :profile, :id => "foo"
response.body.should == "http://test.host/foo"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment