Created
September 19, 2011 20:47
-
-
Save yosemsweet/1227558 to your computer and use it in GitHub Desktop.
Test authentication and authorization in controller specs
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
describe "POST create" do | |
it "should require authentication" do | |
should_require_authentication do | |
canvas = Factory.build(:canvas) | |
post :create, | |
:canvas => { | |
:name => canvas.name, | |
:mission => canvas.mission, | |
:image => canvas.image, | |
:open => canvas.open | |
} | |
end | |
end | |
end | |
end | |
describe "GET show" do | |
it "should not require authentication" do | |
should_not_require_authentication do | |
get :show, | |
:id => Factory.create(:canvas) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment