test/functional/account_controller_test.rb in parlement-0.5 vs test/functional/account_controller_test.rb in parlement-0.6

- old
+ new

@@ -17,10 +17,12 @@ LoginEngine::CONFIG[:salt] = "test-salt" @controller = AccountController.new @request, @response = ActionController::TestRequest.new, ActionController::TestResponse.new @request.host = "localhost" + + @elt = Elt.find '1' end """ _ _ _ __ ___ ___ _ _ __| | ___ ___ _ __ | |_ _ @@ -235,7 +237,29 @@ :user => { :password => "newpassword" } assert_not_nil session[:person] assert_not_nil session[:user] get :logout end + + def test_update_subscribe + post :login, :person => { :name => "bob_other", :email => "" }, + :user => { :password => "" }, :divId => 'author_ROOT' + + controller = @controller + @controller = EltController.new + post :create, :id => @elt.id, :commit => "Propose!", + :elt =>{ + :body => "+1", :subject => "test_create", :parent_id => @elt.id } + @controller = controller + get :logout + + post :login, :person => { :name => "bob_other", :email => "" }, + :user => { :password => "" }, :divId => 'author_1' + + assert_success + assert_not_nil session[:person] + assert_template 'account/_show' + + assert_tag :tag => "div", :attributes => { :class => "choicesToUpdate" } + end end