about registe test

hello:

    An action needed to test is: def register     @user=User.new(params[:user])

    if params[:user] && @user.save       # if province=="北京"...,set the city attr'value the same as province       province=params[:user][:province]       if province=="北京" || province=="天津" || province=="重庆" || province=="上海" || province=="香港" || province=="澳门"        @user.city=@user.province        @user.save       end         session[:login]=@user.id         flash[:register]="#{@user.name}已创建"         redirect_to :action=>"upanel"     else         render :action=>"register"     end   end

who can help me?

hello:

    An action needed to test is: def register     @user=User.new(params[:user])

    if params[:user] && @user.save       # if province=="北京"...,set the city attr'value the same as province       province=params[:user][:province]       if province=="北京" || province=="天津" || province=="重庆" || province=="上海" || province=="香港" || province=="澳门"        @user.city=@user.province        @user.save       end         session[:login]=@user.id         flash[:register]="#{@user.name}已创建"         redirect_to :action=>"upanel"     else         render :action=>"register"     end   end

######################### The test is :     require File.dirname(__FILE__) + '/../test_helper' require 'login_controller' class LoginControllerTest < ActionController::TestCase   # Replace this with your real tests.   def setup     @login_instance=LoginController.new     @request=ActionController::TestRequest.new     @response=ActionController::TestResponse.new   end   def test_truth     assert true   end   def test_register_suc     post :register,:user=>{:id=>1,                     :photo=>"/images/users/fan_hong.jpg",                     :ball_kind=>"篮球",                     :name=>"范宏",                     :password=>"3338179",                     :password_confirmation=>"3338179",                     :age=>"30",                     :sex=>"男",                     :education=>"本科",                     :career=>"工程师",                     :province=>"北京",                     :section=>"朝阳区",                     :email=>"fh@163.com",                     :qq=>"369963"}     assert_response :success     assert_redirected_to :action=>"upanel"     assert_equal 1,session[:login]     assert_equal "范宏已创建",flash[:register]     assert_equal "北京",assigns(:user).city   end end

############# when i run the test,there is one fail,which says like this: expected 1 or "范宏已创建"or "北京",but is nil. it seems that this test does not call the method register.But in reality,the register method work fine when i submit the form.I do not know where is wrong in my test code.please help me! thank you!