I want to extract the method for logging in so that I don't have to include it in each before call.<br><br>Is it bad to use a describe block within the rspec_helper in a rails project for controller tests?<br><br>I have in my spec_helper.rb
<br><br>describe "an authenticated request", :shared => true do<br> before( :each ) do<br> @u = mock_model( User )<br> mock_login( @u )<br> end<br><br> def mock_login( user )<br> session[:user] = user
<br> controller.send( :instance_variable_set, :@current_user, user )<br> controller.stub!( :current_user ).and_return( user )<br> end<br><br>end<br><br><br>which I then share in my relevant controller tests with<br>
<br> it_should_behave_like "an authenticated request"<br><br>Is this bad? <br><br>