Sha256: 3913ccf007d97c32f4b0399e74fac5bc19788b533c5001271d27a34066299eb1

Contents?: true

Size: 943 Bytes

Versions: 6

Compression:

Stored size: 943 Bytes

Contents

require "rails_helper"

# Specs in this file have access to a helper object that includes
# the SubdivisionsHelper. For example:
#
# describe SubdivisionsHelper do
#   describe "string concat" do
#     it "concats two strings with spaces" do
#       expect(helper.concat_strings("this","that")).to eq("this that")
#     end
#   end
# end
module SubdivisionSelect
  RSpec.describe SubdivisionsHelper, type: :helper do
    it "gets subdivisions for Germany" do
      expect(SubdivisionsHelper::get_subdivisions("DE")["BE"]).to eq("Berlin")
      expect(SubdivisionsHelper::get_subdivisions("DE").count).to eq(16)
    end

    # TODO: actually check if a select would be correct
    it "gets subdivisions_for_select for Germany" do
      german_states = SubdivisionsHelper::get_subdivisions("DE")
      for_select = SubdivisionsHelper::get_subdivisions_for_select("DE")
      expect(for_select).to eq(german_states.invert.to_a)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
subdivision_select-0.0.6 spec/helpers/subdivision_select/subdivisions_helper_spec.rb
subdivision_select-0.0.5 spec/helpers/subdivision_select/subdivisions_helper_spec.rb
subdivision_select-0.0.4 spec/helpers/subdivision_select/subdivisions_helper_spec.rb
subdivision_select-0.0.3 spec/helpers/subdivision_select/subdivisions_helper_spec.rb
subdivision_select-0.0.2 spec/helpers/subdivision_select/subdivisions_helper_spec.rb
subdivision_select-0.0.1 spec/helpers/subdivision_select/subdivisions_helper_spec.rb