Created
December 26, 2008 14:57
-
-
Save lmarburger/40072 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
require 'test_helper' | |
class PersonControllerTest < ActionController::TestCase | |
context "viewing a person" do | |
setup do | |
@session = { :person_id => @person_id = 1 } | |
@get_person = lambda { get :index, { :person_id => @person_id }, @session } | |
end | |
context "anonymously" do | |
setup do | |
@session = nil | |
@get_person.call | |
end | |
should_redirect_to 'new_session_path' | |
end | |
context "authenticated" do | |
setup { @get_person.call } | |
should_respond_with :success | |
should_render_template :show | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment