test/applications/main/test/integration/visible_test.rb in tabulous-0.0.2 vs test/applications/main/test/integration/visible_test.rb in tabulous-1.0.0

- old
+ new

@@ -1,44 +1,48 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__)) class VisibleTest < ActionController::IntegrationTest def setup - use_initializer %Q{ + use_tab_file %Q{ Tabulous.setup do |config| - config.tabs = [ - #-------------------------------------------------------------------------------------------------------------------------------# - # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? # - #-------------------------------------------------------------------------------------------------------------------------------# - [ :home_tab , 'Explanation' , "/" , true , true ], - [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ], - [ :stars_tab , 'Stars' , "/stars" , lambda { controller_name =~ /s/ } , true ], - [ :planets_tab , 'Planets' , "/planets" , false , true ], - [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ], - [ :one_subtab , 'One' , "/subtabs/one" , true , true ], - [ :two_subtab , 'Two' , "/subtabs/two" , false , true ], - [ :three_subtab , 'Three' , "/subtabs/three" , lambda { false } , true ], - #-------------------------------------------------------------------------------------------------------------------------------# - # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? # - #-------------------------------------------------------------------------------------------------------------------------------# - ] + config.tabs do + [ + #-------------------------------------------------------------------------------------------------------------------------------# + # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? # + #-------------------------------------------------------------------------------------------------------------------------------# + [ :home_tab , 'Explanation' , "/" , true , true ], + [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ], + [ :stars_tab , 'Stars' , "/stars" , controller_name =~ /s/ , true ], + [ :planets_tab , 'Planets' , "/planets" , false , true ], + [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ], + [ :one_subtab , 'One' , "/subtabs/one" , true , true ], + [ :two_subtab , 'Two' , "/subtabs/two" , false , true ], + [ :three_subtab , 'Three' , "/subtabs/three" , !true , true ], + #-------------------------------------------------------------------------------------------------------------------------------# + # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? # + #-------------------------------------------------------------------------------------------------------------------------------# + ] + end - config.actions = [ - #-------------------------------------------------------------# - # CONTROLLER | ACTION | TAB # - #-------------------------------------------------------------# - [ :home , :all_actions , :home_tab ], - [ :galaxies , :all_actions , :galaxies_tab ], - [ :stars , :all_actions , :stars_tab ], - [ :planets , :all_actions , :planets_tab ], - [ :subtabs , :one , :one_subtab ], - [ :subtabs , :two , :two_subtab ], - [ :subtabs , :three , :three_subtab ], - #-------------------------------------------------------------# - # CONTROLLER | ACTION | TAB # - #-------------------------------------------------------------# - ] + config.actions do + [ + #-------------------------------------------------------------# + # CONTROLLER | ACTION | TAB # + #-------------------------------------------------------------# + [ :home , :all_actions , :home_tab ], + [ :galaxies , :all_actions , :galaxies_tab ], + [ :stars , :all_actions , :stars_tab ], + [ :planets , :all_actions , :planets_tab ], + [ :subtabs , :one , :one_subtab ], + [ :subtabs , :two , :two_subtab ], + [ :subtabs , :three , :three_subtab ], + #-------------------------------------------------------------# + # CONTROLLER | ACTION | TAB # + #-------------------------------------------------------------# + ] + end config.css.scaffolding = true end }