Created
January 11, 2009 11:40
-
-
Save smtm/45694 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---A Method in Test_helper.rb | |
def login_pmtwo | |
u=User.new(:login =>"pmtwo",:password =>"secret",:administrator =>true) | |
post :login, :login=>'pmtwo', :password=>'secret' | |
end | |
---:projects_controller.rb | |
require File.dirname(__FILE__) + '/../test_helper' | |
class ProjectsControllerTest < ActionController::TestCase | |
context "on GET to :show" do | |
setup do | |
login_pmtwo | |
@controller = ProjectsController.new | |
@request = ActionController::TestRequest.new | |
@response = ActionController::TestResponse.new | |
get :show, :id =>1 | |
end | |
should_assign_to :project | |
should_respond_with :success | |
should_not_set_the_flash | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment