diff options
author | francis <francis> | 2007-10-31 12:39:58 +0000 |
---|---|---|
committer | francis <francis> | 2007-10-31 12:39:58 +0000 |
commit | af4055e002f7d9b12ec492e1a9b78a6a6aff5bb3 (patch) | |
tree | f59c9c1c0871bb03a7af1472bda6a67cc469005e /spec/controllers/user_controller_spec.rb | |
parent | c023cfab330de526892126ae722d7bfcc1d22c96 (diff) |
Tests for some controllers.
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb new file mode 100644 index 000000000..8354e774c --- /dev/null +++ b/spec/controllers/user_controller_spec.rb @@ -0,0 +1,27 @@ +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 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 |