Sha256: 1405271387f12ee12315939e6c38e0fec0df47666843757f6ee1e333be47bcca

Contents?: true

Size: 925 Bytes

Versions: 18

Compression:

Stored size: 925 Bytes

Contents

require 'spec_helper'

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

  def countries locale = :en
    path = File.join(SPEC_DIR, "../config/countries/locale_countries.#{locale}.json")
    JSON.parse File.read(path)
  end

  before do
    WorldFlags.auto_select!
    I18n.locale = :en
    WorldFlags.available_locales = [:da, :sv, :nb, :en]
    WorldFlags.reset!
    WorldFlags.countries = countries
    WorldFlags.raise_error!
  end

  it "should list flags using Array" do
    output = flags_list 32 do
      flags [:ar, :gb]
    end
    output.should == "<ul class=\"f32\"><li class=\"flag ar\" data-cc=\"ar\" data-country_name=\"Argentina\" data-language_name=\"Spanish\" data-locale=\"ar\">&nbsp;</li><li class=\"flag gb\" data-cc=\"gb\" data-country_name=\"United Kingdom\" data-language_name=\"British English\" data-locale=\"gb\">&nbsp;</li></ul>"
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
world-flags-0.6.5 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.4 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.3.1 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.3 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.2.1 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.2 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.1.1 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.1 spec/world_flags/json/json_countries_spec.rb
world-flags-0.6.0 spec/world_flags/json/json_countries_spec.rb
world-flags-0.5.1 spec/world_flags/json/json_countries_spec.rb
world-flags-0.5.0 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.9 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.8.3 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.8.2 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.7 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.5 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.4 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.3 spec/world_flags/json/json_countries_spec.rb