# frozen_string_literal: true require 'spec_helper' require 'action_view' require 'country_select' class Walrus attr_accessor :country_code end describe 'CountrySelect' do include ActionView::Helpers::TagHelper include ActionView::Helpers::FormOptionsHelper before do I18n.available_locales = [:en] I18n.locale = :en ISO3166.reset end let(:walrus) { Walrus.new } let!(:template) { ActionView::Base.new(ActionView::LookupContext.new([]), {}, nil) } let(:builder) do if defined?(ActionView::Helpers::Tags::Base) ActionView::Helpers::FormBuilder.new(:walrus, walrus, template, {}) else ActionView::Helpers::FormBuilder.new(:walrus, walrus, template, {}, proc {}) end end let(:select_tag) do <<-HTML.chomp.strip