Sha256: d39002b500d8e050c4081824484cb92f3b6d0d78618b3f295de29a824a450940

Contents?: true

Size: 855 Bytes

Versions: 1

Compression:

Stored size: 855 Bytes

Contents

require 'spec_helper'

describe WorldFlags::Helper::View do
  include ControllerTestHelpers,
          WorldFlags::Helper::View

  let(:default_size) { 24 }

  before do
    I18n.locale = 'en'

    WorldFlags.config do |c|
      c.auto_select!    
      c.available_locales = [:ar, :en]
      c.reset!
      c.raise_error!
    end
  end

  describe 'customize flag tags and text' do
    before do
      WorldFlags.config do |c|
        c.flag_list_tag = :div
        c.flag_tag = :span
        c.flag_text = ''
      end
    end

    it "should list flags using customized tags and text" do
      output = flags_list 32 do
        flags [:ar]
      end
      output.should == "<div class=\"f32 flags\"><span class=\"flag ar\" data-cc=\"ar\" data-country_name=\"Argentina\" data-language_name=\"Spanish\" data-locale=\"ar\"></span></div>"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
world-flags-0.6.0 spec/world_flags/helper/util_spec.rb