Changeset 1456

Show
Ignore:
Timestamp:
09/19/06 18:13:56 (2 years ago)
Author:
uta
Message:

#114

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • components/bbs/trunk/test/fixtures/bbs_1/rubricks_component_permissions.csv

    r1451 r1456  
    272726,1,10,1 
    282827,4,9,1 
    29 28,5,10,1 
    30 29,4,9,1 
    31 30,5,10,1 
     2928,4,10,1 
     3029,5,10,1 
     3130,6,10,1 
     3231,7,10,1 
     3332,8,10,1 
     3433,9,10,1 
  • components/bbs/trunk/test/fixtures/bbs_1/rubricks_components.csv

    r1399 r1456  
    11id,active,built_in,migrate_version,name,display_name,author,license,version,description,created_on,updated_on 
    2 1,1,1,0,system,[_System_Component_DisplayName],Rubricks.org,MIT,test,Rubricks System Component,2006/3/29,2006/3/29 
    3 2,1,0,1,bbs,[_Bbs_Info_DisplayName],Rubricks.org,MIT,test,Rubricks System Component,2006/3/29,2006/3/29 
     21,1,1,0,system,[_System_Component_DisplayName],Rubricks.org,MIT,test,Rubricks System Component,2006-03-29,2006-03-29 
     32,1,0,1,bbs,[_Bbs_Info_DisplayName],Rubricks.org,MIT,test,Rubricks System Component,2006-03-29,2006-03-29 
  • components/bbs/trunk/test/fixtures/bbs_1/rubricks_groups.csv

    r1451 r1456  
    11id,built_in,parent_id,private_user_id,private_component_id,name,description,created_on,updated_on 
    2 1,1,,,,[_Common_GroupAdmin],Site Administrators,2006/3/29,2006/3/29 
    3 2,1,,,,[_Common_GroupGuest],Guest Users,2006/3/29,2006/3/29 
    4 3,1,,,,[_Common_GroupRegistered],Registered Users,2006/3/29,2006/3/29 
    5 4,1,,,2,bbs test group,bbs test group,2006/3/29,2006/3/29 
    6 5,1,,,2,bbs test group2,bbs test group2,2006/3/29,2006/3/29 
    7 6,1,,,2,bbs test group3,bbs test group3,2006/3/29,2006/3/29 
     21,1,,,,[_Common_GroupAdmin],Site Administrators,2006-03-29,2006-03-29 
     32,1,,,,[_Common_GroupGuest],Guest Users,2006-03-29,2006-03-29 
     43,1,,,,[_Common_GroupRegistered],Registered Users,2006-03-29,2006-03-29 
     54,0,,,2,bbs_admin,bbs test group1,2006-03-29,2006-03-29 
     65,0,,,2,bbs_access_administrator,bbs test group2,2006-03-29,2006-03-29 
     76,0,,,2,bbs_access_moderator,bbs test group3,2006-03-29,2006-03-29 
     87,0,,,2,bbs_access_topic_poster,bbs test group4,2006-03-29,2006-03-29 
     98,0,,,2,bbs_access_poster,bbs test group5,2006-03-29,2006-03-29 
     109,0,,,2,bbs_access_viewer,bbs test group6,2006-03-29,2006-03-29 
     1110,0,,,2,bbs_no_permission,bbs test group7,2006-03-29,2006-03-29 
  • components/bbs/trunk/test/fixtures/bbs_1/rubricks_groups_rubricks_users.csv

    r1451 r1456  
    11id,rubricks_user_id,rubricks_group_id 
    2 1,1,4 
    3 2,1,5 
    4 3,2,4 
    5 4,2,5 
     21,1,1 
     32,1,3 
     43,2,3 
     54,2,4 
     65,3,3 
     76,3,5 
     87,4,3 
     98,4,6 
     109,5,3 
     1110,5,7 
     1211,6,3 
     1312,6,8 
     1413,7,3 
     1514,7,9 
     1615,8,3 
     1716,8,10 
  • components/bbs/trunk/test/fixtures/bbs_1/rubricks_users.csv

    r1427 r1456  
    1 "id","rubricks_theme_id","display_email","login_pass","login_name","certified","name","email_by_admin","note","signature","created_on","updated_on" 
    2 1,2,1,"aaW3cJZ7OSoQM","admin","","Site Admin","admin@example.com","","","2006-09-13","2006-09-13" 
    3 2,2,0,"qw3GwtIpB6mQk","test","","Site Admin2","aa@d.com","","","2006-09-14","2006-09-14" 
     1id,rubricks_theme_id,display_email,login_pass,login_name,certified,name,email_by_admin,note,signature,created_on,updated_on 
     21,2,1,aaW3cJZ7OSoQM,admin,"",Site Admin,admin@example.com,"","",2006-09-13,2006-09-13 
     32,2,0,aaW3cJZ7OSoQM,bbs_1,"",BBS Admin,bbs_admin@example.com,"","",2006-09-13,2006-09-13 
     43,2,0,aaW3cJZ7OSoQM,bbs_2,"",BBS Access-Administrator,bbs_administrator@example.com,"","",2006-09-13,2006-09-13 
     54,2,0,aaW3cJZ7OSoQM,bbs_3,"",BBS Access-Moderator,bbs_moderator@example.com,"","",2006-09-13,2006-09-13 
     65,2,0,aaW3cJZ7OSoQM,bbs_4,"",BBS Access-TopicPoster,bbs_topic_poster@example.com,"","",2006-09-13,2006-09-13 
     76,2,0,aaW3cJZ7OSoQM,bbs_5,"",BBS Access-Poster,bbs_poster@example.com,"","",2006-09-13,2006-09-13 
     87,2,0,aaW3cJZ7OSoQM,bbs_6,"",BBS Access-Viewer,bbs_viewer@example.com,"","",2006-09-13,2006-09-13 
     98,2,0,aaW3cJZ7OSoQM,bbs_7,"",BBS No-Permission,bbs_none@example.com,"","",2006-09-13,2006-09-13 
  • components/bbs/trunk/test/functional/admin_bbs_controller_test.rb

    r1452 r1456  
    3939    assert_equal("main", rmi.action) 
    4040    assert_nil(rmi.external_url) 
    41  
    4241    assert(bi) 
    4342    assert_equal(4, bi.administrator_group_id) 
     
    7372    assert_equal("main", rmi.action) 
    7473    assert_nil(rmi.external_url) 
    75  
    7674    assert(bi) 
    7775    assert_equal(0, bi.administrator_group_id) 
     
    9290    begin 
    9391      post(:create_bbs, post_data) 
    94       flunk() 
     92      flunk 
    9593    rescue ActionController::ValidateException 
    9694    end 
     
    126124    assert_equal("main", rmi.action) 
    127125    assert_nil(rmi.external_url) 
    128  
    129126    assert(bi) 
    130127    assert_equal(4, bi.administrator_group_id) 
     
    159156    assert_equal("main", rmi.action) 
    160157    assert_nil(rmi.external_url) 
    161  
    162158    bi = Bbs::BbsInfo.find(1) 
    163159    assert(bi) 
     
    195191    assert_equal("main", rmi.action) 
    196192    assert_nil(rmi.external_url) 
    197  
    198193    bi = Bbs::BbsInfo.find(1) 
    199194    assert(bi) 
     
    216211    begin 
    217212      post(:edit_bbs, post_data) 
    218       flunk() 
     213      flunk 
    219214    rescue ActionController::ValidateException 
    220215    end 
     
    232227    assert_equal("main", rmi.action) 
    233228    assert_nil(rmi.external_url) 
    234  
    235229    bi = Bbs::BbsInfo.find(1) 
    236230    assert(bi) 
     
    251245報に基づいおBBSテヌブル・メニュヌテヌブルにレコヌドが䜜成されおいるこず 
    252246  def test_edit_bbs_0004 
    253     post_data = {:edit_menu_item => {:title => "'", :description => "'"},  
     247    post_data = {:edit_menu_item => {:title => "'", :description => "'"}, 
    254248                                       :bbs_info => {:id => 1, :administrator_group_id => 4}} 
    255249    post(:edit_bbs, post_data) 
     
    267261    assert_equal("main", rmi.action) 
    268262    assert_nil(rmi.external_url) 
    269  
    270263    bi = Bbs::BbsInfo.find(1) 
    271264    assert(bi) 
     
    287280    bi = Bbs::BbsInfo.find(1, :include => [:bbs_categories => [:bbs_forums => [:bbs_authorized_groups, [:bbs_topics => :bbs_messages]]]]) 
    288281    post(:delete_bbs, post_data) 
    289      
     282 
    290283    assert(!Bbs::BbsInfo.exists?(1)) 
    291     assert(Bbs::BbsInfo.exists?(2)) 
    292  
     284    assert( Bbs::BbsInfo.exists?(2)) 
     285 
     286    assert( RubricksMenuItem.exists?(1)) 
     287    assert( RubricksMenuItem.exists?(1)) 
     288    assert( RubricksMenuItem.exists?(2)) 
     289    assert( RubricksMenuItem.exists?(3)) 
     290    assert( RubricksMenuItem.exists?(4)) 
     291    assert( RubricksMenuItem.exists?(5)) 
     292    assert( RubricksMenuItem.exists?(6)) 
     293    assert( RubricksMenuItem.exists?(7)) 
     294    assert( RubricksMenuItem.exists?(8)) 
     295    assert( RubricksMenuItem.exists?(9)) 
     296    assert( RubricksMenuItem.exists?(10)) 
     297    assert( RubricksMenuItem.exists?(11)) 
     298    assert( RubricksMenuItem.exists?(12)) 
     299    assert( RubricksMenuItem.exists?(13)) 
     300    assert( RubricksMenuItem.exists?(14)) 
     301    assert( RubricksMenuItem.exists?(15)) 
     302    assert( RubricksMenuItem.exists?(16)) 
    293303    assert(!RubricksMenuItem.exists?(17)) 
    294     assert(RubricksMenuItem.exists?(1)) 
    295     assert(RubricksMenuItem.exists?(1)) 
    296     assert(RubricksMenuItem.exists?(2)) 
    297     assert(RubricksMenuItem.exists?(3)) 
    298     assert(RubricksMenuItem.exists?(4)) 
    299     assert(RubricksMenuItem.exists?(5)) 
    300     assert(RubricksMenuItem.exists?(6)) 
    301     assert(RubricksMenuItem.exists?(7)) 
    302     assert(RubricksMenuItem.exists?(8)) 
    303     assert(RubricksMenuItem.exists?(9)) 
    304     assert(RubricksMenuItem.exists?(10)) 
    305     assert(RubricksMenuItem.exists?(11)) 
    306     assert(RubricksMenuItem.exists?(12)) 
    307     assert(RubricksMenuItem.exists?(13)) 
    308     assert(RubricksMenuItem.exists?(14)) 
    309     assert(RubricksMenuItem.exists?(15)) 
    310     assert(RubricksMenuItem.exists?(16)) 
    311304 
    312305    assert(!Bbs::BbsCategory.exists?(1)) 
    313306    assert(!Bbs::BbsCategory.exists?(2)) 
    314307    assert(!Bbs::BbsCategory.exists?(3)) 
    315     assert(Bbs::BbsCategory.exists?(4)) 
    316     assert(Bbs::BbsCategory.exists?(5)) 
    317     assert(Bbs::BbsCategory.exists?(6)) 
    318         
     308    assert( Bbs::BbsCategory.exists?(4)) 
     309    assert( Bbs::BbsCategory.exists?(5)) 
     310    assert( Bbs::BbsCategory.exists?(6)) 
     311 
    319312    assert(!Bbs::BbsForum.exists?(1)) 
    320313    assert(!Bbs::BbsForum.exists?(2)) 
    321314    assert(!Bbs::BbsForum.exists?(3)) 
    322315    assert(!Bbs::BbsForum.exists?(4)) 
    323     assert(Bbs::BbsForum.exists?(5)) 
    324     assert(Bbs::BbsForum.exists?(6)) 
    325        
     316    assert( Bbs::BbsForum.exists?(5)) 
     317    assert( Bbs::BbsForum.exists?(6)) 
     318 
    326319    assert(!Bbs::BbsTopic.exists?(1)) 
    327320    assert(!Bbs::BbsTopic.exists?(2)) 
    328321    assert(!Bbs::BbsTopic.exists?(3)) 
    329322    assert(!Bbs::BbsTopic.exists?(4)) 
    330     assert(Bbs::BbsTopic.exists?(5)) 
    331     assert(Bbs::BbsTopic.exists?(6)) 
     323    assert( Bbs::BbsTopic.exists?(5)) 
     324    assert( Bbs::BbsTopic.exists?(6)) 
    332325 
    333326    assert(!Bbs::BbsMessage.exists?(1)) 
     
    335328    assert(!Bbs::BbsMessage.exists?(3)) 
    336329    assert(!Bbs::BbsMessage.exists?(4)) 
    337     assert(Bbs::BbsMessage.exists?(5)) 
    338     assert(Bbs::BbsMessage.exists?(6)) 
     330    assert( Bbs::BbsMessage.exists?(5)) 
     331    assert( Bbs::BbsMessage.exists?(6)) 
    339332 
    340333    assert(!Bbs::BbsAuthorizedGroup.exists?(1)) 
     
    344337    assert(!Bbs::BbsAuthorizedGroup.exists?(5)) 
    345338    assert(!Bbs::BbsAuthorizedGroup.exists?(6)) 
    346     assert(Bbs::BbsAuthorizedGroup.exists?(7)) 
    347     assert(Bbs::BbsAuthorizedGroup.exists?(8)) 
     339    assert( Bbs::BbsAuthorizedGroup.exists?(7)) 
     340    assert( Bbs::BbsAuthorizedGroup.exists?(8)) 
    348341  end 
    349342end 
  • components/bbs/trunk/test/functional/bbs_forum_controller_test.rb

    r1452 r1456  
    5151    assert_equal("", bc.category_description) 
    5252    assert_equal(1, bc.bbs_info_id) 
    53   end  
     53  end 
    5454 
    5555  #[怜蚌冠
     
    6666    begin 
    6767      post(:create_category, post_data) 
    68       flunk() 
     68      flunk 
    6969    rescue ActionController::ValidateException 
    7070    end 
    7171    assert_nil(Bbs::BbsCategory.find_by_category_description("カテゎリ説明")) 
    72   end  
     72  end 
    7373 
    7474  #[怜蚌冠
     
    105105    begin 
    106106      post(:create_category, post_data) 
    107       flunk() 
     107      flunk 
    108108    rescue ActionController::ValidateException 
    109109    end 
     
    145145報に基づいおカテゎリテヌブルにレコヌドが䜜成されおいるこず 
    146146  def test_create_category_0007 
    147     post_data = {:create_category => {:category_name => "",  
     147    post_data = {:create_category => {:category_name => "", 
    148148    :category_description => ""}} 
    149149    post(:create_category, post_data) 
     
    168168    begin 
    169169      post(:create_category, post_data) 
    170       flunk() 
     170      flunk 
    171171    rescue ActionController::ValidateException 
    172172    end 
     
    189189    begin 
    190190      post(:create_category, post_data) 
    191       flunk() 
     191      flunk 
    192192    rescue ActionController::ValidateException 
    193193    end 
     
    251251    begin 
    252252      post(:edit_category, post_data) 
    253       flunk() 
     253      flunk 
    254254    rescue ActionController::ValidateException 
    255255    end 
     
    317317報に基づいおカテゎリテヌブルのレコヌドが曎新されおいるこず 
    318318  def test_edit_category_0006 
    319     post_data = {:edit_category => {:id => 1, :category_name => "",  
     319    post_data = {:edit_category => {:id => 1, :category_name => "", 
    320320    :category_description => ""}} 
    321321    post(:edit_category, post_data) 
     
    341341    begin 
    342342      post(:edit_category, post_data) 
    343       flunk() 
     343      flunk 
    344344    rescue ActionController::ValidateException 
    345345    end 
     
    366366    begin 
    367367      post(:edit_category, post_data) 
    368       flunk() 
     368      flunk 
    369369    rescue ActionController::ValidateException 
    370370    end 
     
    391391 
    392392    assert(!Bbs::BbsCategory.exists?(1)) 
    393     assert(Bbs::BbsCategory.exists?(2)) 
    394     assert(Bbs::BbsCategory.exists?(3)) 
    395     assert(Bbs::BbsCategory.exists?(4)) 
    396     assert(Bbs::BbsCategory.exists?(5)) 
    397     assert(Bbs::BbsCategory.exists?(6)) 
    398         
     393    assert( Bbs::BbsCategory.exists?(2)) 
     394    assert( Bbs::BbsCategory.exists?(3)) 
     395    assert( Bbs::BbsCategory.exists?(4)) 
     396    assert( Bbs::BbsCategory.exists?(5)) 
     397    assert( Bbs::BbsCategory.exists?(6)) 
     398 
    399399    assert(!Bbs::BbsForum.exists?(1)) 
    400400    assert(!Bbs::BbsForum.exists?(2)) 
    401     assert(Bbs::BbsForum.exists?(3)) 
    402     assert(Bbs::BbsForum.exists?(4)) 
    403     assert(Bbs::BbsForum.exists?(5)) 
    404     assert(Bbs::BbsForum.exists?(6)) 
    405        
     401    assert( Bbs::BbsForum.exists?(3)) 
     402    assert( Bbs::BbsForum.exists?(4)) 
     403    assert( Bbs::BbsForum.exists?(5)) 
     404    assert( Bbs::BbsForum.exists?(6)) 
     405 
    406406    assert(!Bbs::BbsTopic.exists?(1)) 
    407407    assert(!Bbs::BbsTopic.exists?(2)) 
    408408    assert(!Bbs::BbsTopic.exists?(3)) 
    409     assert(Bbs::BbsTopic.exists?(4)) 
    410     assert(Bbs::BbsTopic.exists?(5)) 
    411     assert(Bbs::BbsTopic.exists?(6)) 
     409    assert( Bbs::BbsTopic.exists?(4)) 
     410    assert( Bbs::BbsTopic.exists?(5)) 
     411    assert( Bbs::BbsTopic.exists?(6)) 
    412412 
    413413    assert(!Bbs::BbsMessage.exists?(1)) 
     
    415415    assert(!Bbs::BbsMessage.exists?(3)) 
    416416    assert(!Bbs::BbsMessage.exists?(4)) 
    417     assert(Bbs::BbsMessage.exists?(5)) 
    418     assert(Bbs::BbsMessage.exists?(6)) 
     417    assert( Bbs::BbsMessage.exists?(5)) 
     418    assert( Bbs::BbsMessage.exists?(6)) 
    419419 
    420420    assert(!Bbs::BbsAuthorizedGroup.exists?(1)) 
    421421    assert(!Bbs::BbsAuthorizedGroup.exists?(2)) 
    422422    assert(!Bbs::BbsAuthorizedGroup.exists?(3)) 
    423     assert(Bbs::BbsAuthorizedGroup.exists?(4)) 
    424     assert(Bbs::BbsAuthorizedGroup.exists?(5)) 
    425     assert(Bbs::BbsAuthorizedGroup.exists?(6)) 
    426     assert(Bbs::BbsAuthorizedGroup.exists?(7)) 
    427     assert(Bbs::BbsAuthorizedGroup.exists?(8)) 
     423    assert( Bbs::BbsAuthorizedGroup.exists?(4)) 
     424    assert( Bbs::BbsAuthorizedGroup.exists?(5)) 
     425    assert( Bbs::BbsAuthorizedGroup.exists?(6)) 
     426    assert( Bbs::BbsAuthorizedGroup.exists?(7)) 
     427    assert( Bbs::BbsAuthorizedGroup.exists?(8)) 
    428428  end 
    429429 
     
    500500    begin 
    501501      post(:create_forum, post_data) 
    502       flunk() 
     502      flunk 
    503503    rescue ActionController::ValidateException 
    504504    end 
     
    576576報に基づいおフォヌラムテヌブルにレコヌドが䜜成されおいるこず 
    577577  def test_create_forum_0006 
    578     post_data = {:create_forum => {:forum_name => "",  
     578    post_data = {:create_forum => {:forum_name => "", 
    579579    :forum_description => "", 
    580580    :bbs_category_id => 1, :closed => 0, :locked => 1, :moderator_group_id => 4}} 
     
    608608    begin 
    609609      post(:create_forum, post_data) 
    610       flunk() 
     610      flunk 
    611611    rescue ActionController::ValidateException 
    612612    end 
     
    630630    begin 
    631631      post(:create_forum, post_data) 
    632       flunk() 
     632      flunk 
    633633    rescue ActionController::ValidateException 
    634634    end 
     
    710710    begin 
    711711      post(:edit_forum, post_data) 
    712       flunk() 
     712      flunk 
    713713    rescue ActionController::ValidateException 
    714714    end 
     
    799799報に基づいおフォヌラムテヌブルのレコヌドが曎新されおいるこず 
    800800  def test_edit_forum_0006 
    801     post_data = {:edit_forum => {:id => 1, :forum_name => "",  
     801    post_data = {:edit_forum => {:id => 1, :forum_name => "", 
    802802                 :forum_description => "", 
    803803                 :bbs_category_id => 1, :closed => 0, :locked => 1, :moderator_group_id => 4}} 
     
    832832    begin 
    833833      post(:edit_forum, post_data) 
    834       flunk() 
     834      flunk 
    835835    rescue ActionController::ValidateException 
    836836    end 
     
    865865    begin 
    866866      post(:edit_forum, post_data) 
    867       flunk() 
     867      flunk 
    868868    rescue ActionController::ValidateException 
    869869    end 
     
    897897 
    898898    assert(!Bbs::BbsForum.exists?(1)) 
    899     assert(Bbs::BbsForum.exists?(2)) 
    900     assert(Bbs::BbsForum.exists?(3)) 
    901     assert(Bbs::BbsForum.exists?(4)) 
    902     assert(Bbs::BbsForum.exists?(5)) 
    903     assert(Bbs::BbsForum.exists?(6)) 
    904        
     899    assert( Bbs::BbsForum.exists?(2)) 
     900    assert( Bbs::BbsForum.exists?(3)) 
     901    assert( Bbs::BbsForum.exists?(4)) 
     902    assert( Bbs::BbsForum.exists?(5)) 
     903    assert( Bbs::BbsForum.exists?(6)) 
     904 
    905905    assert(!Bbs::BbsTopic.exists?(1)) 
    906906    assert(!Bbs::BbsTopic.exists?(2)) 
    907     assert(Bbs::BbsTopic.exists?(3)) 
    908     assert(Bbs::BbsTopic.exists?(4)) 
    909     assert(Bbs::BbsTopic.exists?(5)) 
    910     assert(Bbs::BbsTopic.exists?(6)) 
     907    assert( Bbs::BbsTopic.exists?(3)) 
     908    assert( Bbs::BbsTopic.exists?(4)) 
     909    assert( Bbs::BbsTopic.exists?(5)) 
     910    assert( Bbs::BbsTopic.exists?(6)) 
    911911 
    912912    assert(!Bbs::BbsMessage.exists?(1)) 
    913913    assert(!Bbs::BbsMessage.exists?(2)) 
    914914    assert(!Bbs::BbsMessage.exists?(3)) 
    915     assert(Bbs::BbsMessage.exists?(4)) 
    916     assert(Bbs::BbsMessage.exists?(5)) 
    917     assert(Bbs::BbsMessage.exists?(6)) 
     915    assert( Bbs::BbsMessage.exists?(4)) 
     916    assert( Bbs::BbsMessage.exists?(5)) 
     917    assert( Bbs::BbsMessage.exists?(6)) 
    918918 
    919919    assert(!Bbs::BbsAuthorizedGroup.exists?(1)) 
    920920    assert(!Bbs::BbsAuthorizedGroup.exists?(2)) 
    921921    assert(!Bbs::BbsAuthorizedGroup.exists?(3)) 
    922     assert(Bbs::BbsAuthorizedGroup.exists?(4)) 
    923     assert(Bbs::BbsAuthorizedGroup.exists?(5)) 
    924     assert(Bbs::BbsAuthorizedGroup.exists?(6)) 
    925     assert(Bbs::BbsAuthorizedGroup.exists?(7)) 
    926     assert(Bbs::BbsAuthorizedGroup.exists?(8)) 
     922    assert( Bbs::BbsAuthorizedGroup.exists?(4)) 
     923    assert( Bbs::BbsAuthorizedGroup.exists?(5)) 
     924    assert( Bbs::BbsAuthorizedGroup.exists?(6)) 
     925    assert( Bbs::BbsAuthorizedGroup.exists?(7)) 
     926    assert( Bbs::BbsAuthorizedGroup.exists?(8)) 
    927927  end 
    928928end 
  • components/bbs/trunk/test/functional/bbs_message_controller_test.rb

    r1452 r1456  
    3333    assert_equal(1, bm.message_no) 
    3434    assert_equal("メッセヌゞのメッセヌゞ", bm.message) 
    35      
     35 
    3636    bc = Bbs::BbsTopic.find(4) 
    3737    assert(bc) 
     
    3939    assert_equal(false, bc.locked) 
    4040    assert_equal(1, bc.topic_poster_id) 
    41     assert_equal("Site Admin", bc.last_poster_name)  
     41    assert_equal("Site Admin", bc.last_poster_name) 
    4242    assert_equal(bm.created_on, bc.last_posted) 
    4343  end 
     
    5656    begin 
    5757      post(:create_message, post_data) 
    58       flunk() 
     58      flunk 
    5959    rescue ActionController::ValidateException 
    6060    end 
     
    7575    begin 
    7676      post(:create_message, post_data) 
    77       flunk() 
     77      flunk 
    7878    rescue ActionController::ValidateException 
    7979    end 
     
    102102    assert_equal(1, bm.message_no) 
    103103    assert_equal("'", bm.message) 
    104      
     104 
    105105    bc = Bbs::BbsTopic.find(4) 
    106106    assert(bc) 
     
    108108    assert_equal(false, bc.locked) 
    109109    assert_equal(1, bc.topic_poster_id) 
    110     assert_equal("Site Admin", bc.last_poster_name)  
     110    assert_equal("Site Admin", bc.last_poster_name) 
    111111    assert_equal(bm.created_on, bc.last_posted) 
    112112  end 
     
    125125    begin 
    126126      post(:create_message, post_data) 
    127       flunk() 
     127      flunk 
    128128    rescue ActionController::ValidateException 
    129129    end 
     
    144144    begin 
    145145      post(:create_message, post_data) 
    146       flunk() 
     146      flunk 
    147147    rescue ActionController::ValidateException 
    148148    end 
     
    172172    assert_equal(1, bm.message_no) 
    173173    assert_equal("", bm.message) 
    174      
     174 
    175175    bc = Bbs::BbsTopic.find(4) 
    176176    assert(bc) 
     
    178178    assert_equal(false, bc.locked) 
    179179    assert_equal(1, bc.topic_poster_id) 
    180     assert_equal("Site Admin", bc.last_poster_name)  
     180    assert_equal("Site Admin", bc.last_poster_name) 
    181181    assert_equal(bm.created_on, bc.last_posted) 
    182182  end 
     
    195195報に基づいおメッセヌゞテヌブルにレコヌドが䜜成されおいるこず 
    196196  def test_create_message_0008 
    197     post_data = {:create_message => {:message_title => "",  
     197    post_data = {:create_message => {:message_title => "", 
    198198                 :message => "" + 
    199199                                                 "" + 
     
    243243                 "" + 
    244244                 "", bm.message) 
    245      
    246245    bc = Bbs::BbsTopic.find(4) 
    247246    assert(bc) 
     
    249248    assert_equal(false, bc.locked) 
    250249    assert_equal(1, bc.topic_poster_id) 
    251     assert_equal("Site Admin", bc.last_poster_name)  
     250    assert_equal("Site Admin", bc.last_poster_name) 
    252251    assert_equal(bm.created_on, bc.last_posted) 
    253252  end 
     
    264263  #  ValidateExceptionが発生し、レコヌドが䜜成されないこず 
    265264  def test_create_message_0009 
    266     post_data = {:create_message => {:message_title => "", :message => "1"}}    
     265    post_data = {:create_message => {:message_title => "", :message => "1"}} 
    267266    begin 
    268267      post(:create_message, post_data) 
    269       flunk() 
     268      flunk 
    270269    rescue ActionController::ValidateException 
    271270    end 
     
    284283  #  ValidateExceptionが発生し、レコヌドが䜜成されないこず 
    285284  def test_create_message_0010 
    286     post_data = {:create_message => {:message_title => "メッセヌゞ",  
     285    post_data = {:create_message => {:message_title => "メッセヌゞ", 
    287286                                     :message => "" + 
    288287                                                 "" + 
     
    307306    begin 
    308307      post(:create_message, post_data) 
    309       flunk() 
     308      flunk 
    310309    rescue ActionController::ValidateException 
    311310    end 
     
    330329    assert(bm) 
    331330    assert_equal(1, bm.bbs_topic_id) 
    332     assert_equal("メッセヌゞ", bm.message_title)  
     331    assert_equal("メッセヌゞ", bm.message_title) 
    333332    assert_equal(1, bm.bbs_topic_id) 
    334333    assert_equal("メッセヌゞのメッセヌゞ", bm.message) 
     
    349348    begin 
    350349      post(:edit_message, post_data) 
    351       flunk() 
    352     rescue ActionController::ValidateException 
    353     end 
    354     bm = Bbs::BbsMessage.find(1) 
    355     assert(bm) 
    356     assert_equal(1, bm.bbs_topic_id) 
    357     assert_equal("test_message_title1", bm.message_title)  
     350      flunk 
     351    rescue ActionController::ValidateException 
     352    end 
     353    bm = Bbs::BbsMessage.find(1) 
     354    assert(bm) 
     355    assert_equal(1, bm.bbs_topic_id) 
     356    assert_equal("test_message_title1", bm.message_title) 
    358357    assert_equal(1, bm.bbs_topic_id) 
    359358    assert_equal("test_message1", bm.message) 
     
    378377    assert(bm) 
    379378    assert_equal(1, bm.bbs_topic_id) 
    380     assert_equal("'", bm.message_title)  
     379    assert_equal("'", bm.message_title) 
    381380    assert_equal(1, bm.bbs_topic_id) 
    382381    assert_equal("'", bm.message) 
     
    397396    begin 
    398397      post(:edit_message, post_data) 
    399       flunk() 
    400     rescue ActionController::ValidateException 
    401     end 
    402     bm = Bbs::BbsMessage.find(1) 
    403     assert(bm) 
    404     assert_equal(1, bm.bbs_topic_id) 
    405     assert_equal("test_message_title1", bm.message_title)  
     398      flunk 
     399    rescue ActionController::ValidateException 
     400    end 
     401    bm = Bbs::BbsMessage.find(1) 
     402    assert(bm) 
     403    assert_equal(1, bm.bbs_topic_id) 
     404    assert_equal("test_message_title1", bm.message_title) 
    406405    assert_equal(1, bm.bbs_topic_id) 
    407406    assert_equal("test_message1", bm.message) 
     
    427426    assert(bm) 
    428427    assert_equal(1, bm.bbs_topic_id) 
    429     assert_equal("", bm.message_title)  
     428    assert_equal("", bm.message_title) 
    430429    assert_equal(1, bm.bbs_topic_id) 
    431430    assert_equal("", bm.message) 
     
    451450    assert(bm) 
    452451    assert_equal(1, bm.bbs_topic_id) 
    453     assert_equal("", bm.message_title)  
     452    assert_equal("", bm.message_title) 
    454453    assert_equal(1, bm.bbs_topic_id) 
    455454    assert_equal("メッセヌゞ", bm.message) 
     
    468467  #  ValidateExceptionが発生し、レコヌドが曎新されないこず 
    469468  def test_edit_message_0007 
    470     post_data = {:edit_message => {:id => 1, :message_title => "", :message => "メッセヌゞ"}}   
     469    post_data = {:edit_message => {:id => 1, :message_title => "", :message => "メッセヌゞ"}} 
    471470    begin 
    472471      post(:edit_message, post_data) 
    473       flunk() 
    474     rescue ActionController::ValidateException 
    475     end 
    476     bm = Bbs::BbsMessage.find(1) 
    477     assert(bm) 
    478     assert_equal(1, bm.bbs_topic_id) 
    479     assert_equal("test_message_title1", bm.message_title)  
     472      flunk 
     473    rescue ActionController::ValidateException 
     474    end 
     475    bm = Bbs::BbsMessage.find(1) 
     476    assert(bm) 
     477    assert_equal(1, bm.bbs_topic_id) 
     478    assert_equal("test_message_title1", bm.message_title) 
    480479    assert_equal(1, bm.bbs_topic_id) 
    481480    assert_equal("test_message1", bm.message) 
     
    495494    post_data = {:delete_message => {:id => 1}} 
    496495    post(:delete_message, post_data) 
    497      
    498496    assert(!Bbs::BbsMessage.exists?(1)) 
    499     assert(Bbs::BbsMessage.exists?(2)) 
    500     assert(Bbs::BbsMessage.exists?(3)) 
    501     assert(Bbs::BbsMessage.exists?(4)) 
    502     assert(Bbs::BbsMessage.exists?(5)) 
    503     assert(Bbs::BbsMessage.exists?(6)) 
     497    assert( Bbs::BbsMessage.exists?(2)) 
     498    assert( Bbs::BbsMessage.exists?(3)) 
     499    assert( Bbs::BbsMessage.exists?(4)) 
     500    assert( Bbs::BbsMessage.exists?(5)) 
     501    assert( Bbs::BbsMessage.exists?(6)) 
    504502  end 
    505503end 
  • components/bbs/trunk/test/functional/bbs_topic_controller_test.rb

    r1452 r1456  
    3333    assert_equal(false, bc.locked) 
    3434    assert_equal(1, bc.topic_poster_id) 
    35     assert_equal("Site Admin", bc.last_poster_name)  
     35    assert_equal("Site Admin", bc.last_poster_name) 
    3636    assert_equal(bm.created_on, bc.last_posted) 
    3737    assert(bm) 
     
    5656    begin 
    5757      post(:create_topic, post_data) 
    58       flunk() 
     58      flunk 
    5959    rescue ActionController::ValidateException 
    6060    end 
     
    7676    begin 
    7777      post(:create_topic, post_data) 
    78       flunk() 
     78      flunk 
    7979    rescue ActionController::ValidateException 
    8080    end 
     
    103103    assert_equal(false, bc.locked) 
    104104    assert_equal(1, bc.topic_poster_id) 
    105     assert_equal("Site Admin", bc.last_poster_name)  
     105    assert_equal("Site Admin", bc.last_poster_name) 
    106106    assert_equal(bm.created_on, bc.last_posted) 
    107107    assert(bm) 
     
    126126    begin 
    127127      post(:create_topic, post_data) 
    128       flunk() 
     128      flunk 
    129129    rescue ActionController::ValidateException 
    130130    end 
     
    146146    begin 
    147147      post(:create_topic, post_data) 
    148       flunk() 
     148      flunk 
    149149    rescue ActionController::ValidateException 
    150150    end 
     
    174174    assert_equal(false, bc.locked) 
    175175    assert_equal(1, bc.topic_poster_id) 
    176     assert_equal("Site Admin", bc.last_poster_name)  
     176    assert_equal("Site Admin", bc.last_poster_name) 
    177177    assert_equal(bm.created_on, bc.last_posted) 
    178178    assert(bm) 
     
    196196報に基づいおトピックテヌブルにレコヌドが䜜成されおいるこず 
    197197  def test_create_topic_0008 
    198     post_data = {:create_topic => {:topic_title => ""},  
     198    post_data = {:create_topic => {:topic_title => ""}, 
    199199                 :create_message => {:message => "" + 
    200200                                                 "" + 
     
    224224    assert_equal(false, bc.locked) 
    225225    assert_equal(1, bc.topic_poster_id) 
    226     assert_equal("Site Admin", bc.last_poster_name)  
     226    assert_equal("Site Admin", bc.last_poster_name) 
    227227    assert_equal(bm.created_on, bc.last_posted) 
    228228    assert(bm) 
     
    264264  def test_create_topic_0009 
    265265    post_data = {:create_topic => {:topic_title => ""}, 
    266                  :create_message => {:message => "1"}}    
     266                 :create_message => {:message => "1"}} 
    267267    begin 
    268268      post(:create_topic, post_data) 
    269       flunk() 
     269      flunk 
    270270    rescue ActionController::ValidateException 
    271271    end 
     
    307307    begin 
    308308      post(:create_topic, post_data) 
    309       flunk() 
     309      flunk 
    310310    rescue ActionController::ValidateException 
    311311    end 
     
    329329    bc = Bbs::BbsTopic.find(1) 
    330330    assert(bc) 
    331     assert_equal("トピック", bc.topic_title)  
     331    assert_equal("トピック", bc.topic_title) 
    332332    assert_equal(1, bc.bbs_forum_id) 
    333333    assert_equal(true, bc.locked) 
    334334    assert_equal(1, bc.topic_poster_id) 
    335     assert_equal("Site Admin", bc.last_poster_name)  
     335    assert_equal("Site Admin", bc.last_poster_name) 
    336336   end 
    337337 
     
    349349    begin 
    350350      post(:edit_topic, post_data) 
    351       flunk() 
    352     rescue ActionController::ValidateException 
    353     end 
    354     bc = Bbs::BbsTopic.find(1) 
    355     assert(bc) 
    356     assert_equal("test_topic1", bc.topic_title)  
     351      flunk 
     352    rescue ActionController::ValidateException 
     353    end 
     354    bc = Bbs::BbsTopic.find(1) 
     355    assert(bc) 
     356    assert_equal("test_topic1", bc.topic_title) 
    357357    assert_equal(1, bc.bbs_forum_id) 
    358358    assert_equal(false, bc.locked) 
    359359    assert_equal(1, bc.topic_poster_id) 
    360     assert_equal("Site Admin", bc.last_poster_name)  
     360    assert_equal("Site Admin", bc.last_poster_name) 
    361361  end 
    362362 
     
    377377    bc = Bbs::BbsTopic.find(1) 
    378378    assert(bc) 
    379     assert_equal("'", bc.topic_title)  
     379    assert_equal("'", bc.topic_title) 
    380380    assert_equal(1, bc.bbs_forum_id) 
    381381    assert_equal(true, bc.locked) 
    382382    assert_equal(1, bc.topic_poster_id) 
    383     assert_equal("Site Admin", bc.last_poster_name)  
     383    assert_equal("Site Admin", bc.last_poster_name) 
    384384  end 
    385385 
     
    397397    begin 
    398398      post(:edit_topic, post_data) 
    399       flunk() 
    400     rescue ActionController::ValidateException 
    401     end 
    402     bc = Bbs::BbsTopic.find(1) 
    403     assert(bc) 
    404     assert_equal("test_topic1", bc.topic_title)  
     399      flunk 
     400    rescue ActionController::ValidateException 
     401    end 
     402    bc = Bbs::BbsTopic.find(1) 
     403    assert(bc) 
     404    assert_equal("test_topic1", bc.topic_title) 
    405405    assert_equal(1, bc.bbs_forum_id) 
    406406    assert_equal(false, bc.locked) 
    407407    assert_equal(1, bc.topic_poster_id) 
    408     assert_equal("Site Admin", bc.last_poster_name)  
     408    assert_equal("Site Admin", bc.last_poster_name) 
    409409  end 
    410410 
     
    426426    bc = Bbs::BbsTopic.find(1) 
    427427    assert(bc) 
    428     assert_equal("", bc.topic_title)  
     428    assert_equal("", bc.topic_title) 
    429429    assert_equal(1, bc.bbs_forum_id) 
    430430    assert_equal(true, bc.locked) 
    431431    assert_equal(1, bc.topic_poster_id) 
    432     assert_equal("Site Admin", bc.last_poster_name)  
     432    assert_equal("Site Admin", bc.last_poster_name) 
    433433  end 
    434434 
     
    450450    bc = Bbs::BbsTopic.find(1) 
    451451    assert(bc) 
    452     assert_equal("", bc.topic_title)  
     452    assert_equal("", bc.topic_title) 
    453453    assert_equal(1, bc.bbs_forum_id) 
    454454    assert_equal(true, bc.locked) 
    455455    assert_equal(1, bc.topic_poster_id) 
    456     assert_equal("Site Admin", bc.last_poster_name)  
     456    assert_equal("Site Admin