blob: 432c56bb76e751dbbbfbd430eb38062c913e37f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
require File.dirname(__FILE__) + '/../spec_helper'
describe UserController, "when showing a user" do
fixtures :users
it "should be successful" do
get :show, :simple_name => "bob_smith"
response.should be_success
end
it "should redirect to lower case name if given one with capital letters" do
get :show, :simple_name => "Bob_Smith"
response.should redirect_to(:controller => 'user', :action => 'show', :simple_name => "bob_smith")
end
it "should render with 'show' template" do
get :show, :simple_name => "bob_smith"
response.should render_template('show')
end
it "should assign the user" do
get :show, :simple_name => "bob-smith"
assigns[:display_users].should == [ users(:bob_smith_user) ]
end
it "should assign the user for a more complex name" do
get :show, :simple_name => "silly-emnameem"
assigns[:display_users].should == [ users(:silly_name_user) ]
end
# XXX test for 404s when don't give valid name
end
|