require 'spec_helper' describe WorldFlags::Helper::View do include ControllerTestHelpers, WorldFlags::Helper::View before do WorldFlags.auto_select! I18n.locale = 'ar' WorldFlags.active_locales = [:da, :sv, :no, :en, :ar] end it "should be empty, with an empty block" do output = flags_list do end output.should == "" end it "should work with alias :flag_list" do output = flag_list do end output.should == "" end it "should set size to 16 or 32" do lambda do flags_list(8) { } end.should raise_error end it "should set size to 16 or 32" do output = flags_list 32 do end output.should == "" end it "should list flags using Array" do output = flags_list 32 do flags [:ar, :gb] end output.should == "" end it "should list flags using args" do output = flags_list 32 do flags :ar, :gb end output.should == "" end it "should list flags using args and :with_semi" do output = flags_list 32 do flags :ar, :gb, :with_semi => true end output.should == "" end it "should list flags" do output = flag_title :ar, 'Argentina' output.should == "
  •  
  • " end describe 'Countries' do before do I18n.locale = 'da' end it "should list nordic flags using args and :with_semi" do output = flags_list 32 do flags :dk, :se, :no, :with_semi => true, :country => :da end output.should == "" end end end