# frozen_string_literal: true

require "spec_helper"

describe AppsHelper, type: :helper do
  describe ".quote_long_dns_txt_record" do
    it "just quotes a short string" do
      expect(helper.quote_long_dns_txt_record("abc")).to eq '"abc"'
    end

    it "seperates strings longer than 255" do
      expect(helper.quote_long_dns_txt_record(
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890"
             )).to eq \
               "\"12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345678901234567890123456789012345678901234567890" \
               "12345\"" \
               "\"678901234567890123456789012345678901234567890\""
    end
  end
end
