Created
August 25, 2011 20:55
-
-
Save sbeam/1171906 to your computer and use it in GitHub Desktop.
functional testing against authentication - example
This file contains hidden or 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
| class AbstractControllerTest < ActionController::TestCase | |
| context "handle :index" do | |
| context "logged as user" | |
| setup do | |
| logged_as(:user) | |
| get :index | |
| end | |
| should_redirect_to("Root page"){root_path()} | |
| end | |
| context "logged as admin" | |
| setup do | |
| logged_as(:admin) | |
| get :index | |
| end | |
| should_render_template :index | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment