Frederick Cheung-2 wrote:
> 
> 
> 
> That's not quite what I meant. What i meant was
> 
> 
> class ApplicationControllerTest < ActionController::TestCase
>   class StubController < ApplicationController
>     def index
>        render :text => 'index action'
>     end
>   end
>   tests ApplicationControllerTest::StubController
> 
>   test "non logged in user should be redirected to login page" do
>     get :index
>     assert_redirected_to '/login'
>   end
> end
> 
> No mocking involved!
> 
> Fred
> 

Yeah no mocking involved if I'm testing a method with nothing in it but I'm
testing a method with calls to the session object, request object, flash
object and redirect_to

-- 
View this message in context: 
http://old.nabble.com/Finding-it-difficult-to-test-a-before_filter-on-my-ApplicationController-tp28253771p28257679.html
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to