Functional Testing

Hi all,

I am new in Testing I want to test my oauth controller which is using
facebook login and callback I want to prepare the test case for that


home controller contains

class HomeController < ApplicationController
    layout 'home',:only=>["new"]

    before_filter :authenticate_user!, :only=>['new']

    def index
      redirect_to home_path if current_user

    #This method display for all type of videos in home page
    def new
      #render :index
      @videos,@prev,@next= params[:page] ?
Video.display_videos(params[:page].to_i) : Video.display_videos



which uses devise I have written the test case like this

include Devise::TestHelpers

  test "set up " do
    @controller =

  test " Test Index Method" do
     get :index
     assert_response :success
     assert_nil assigns(:home)

     assert_tag :tag => 'div',
          :attributes => { :class => 'w1' }

     assert_response 200
    assert_template 'home/index' # test that the correct view file
would be rendered


  test "testing routes " do
          assert_routing "home", { :controller => 'home',:action =>
'new' } # assert_routing lets you test the routes defined in config/

  test " Test new Method " do
    get :new
    assert_response 302, @response.body


but unable to write the test case for redirect

any one's help is accepted please help me

Thanks in advance and for ever.............