Created
October 13, 2009 17:48
-
-
Save ihoka/209398 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
describe "handling DELETE destroy" do | |
before(:each) do | |
@user_session = mock_model(UserSession, :record => mock_model(User)) | |
UserSession.stub!(:find).and_return(@user_session) | |
@user_session.stub!(:destroy) | |
end | |
def do_delete | |
delete :destroy | |
end | |
it "destroy the user session" do | |
@user_session.should_receive(:destroy) | |
do_delete | |
end | |
it "redirects to the home page" do | |
do_delete | |
flash[:notice].should == "Logout successful!" | |
response.should redirect_to(root_path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment