Sha256: f8449690b67846209d8005b0307ebfd89e88705d73a0b3241e1c09eba42f4868

Contents?: true

Size: 942 Bytes

Versions: 5

Compression:

Stored size: 942 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 = Hashie::Mash.new 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

5 entries across 5 versions & 1 rubygems

Version Path
world-flags-0.4.2 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.1 spec/world_flags/json/json_countries_spec.rb
world-flags-0.4.0 spec/world_flags/json/json_countries_spec.rb
world-flags-0.3.6 spec/world_flags/json/json_countries_spec.rb
world-flags-0.3.5 spec/world_flags/json/json_countries_spec.rb