summaryrefslogtreecommitdiffstats
path: root/spec/pdf_form_spec.rb
blob: 334678adbf8c89fa2445acaaba7d53132b88dca4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require "spec_helper"

describe "create_pdf_file_name" do
  describe "returns a filename that" do
    let(:band) { Struct.new(:name, :city).new("A: blöddy/band, name!", "Øksendal, Flünsbørg") }

    before :each do
      @filename = create_pdf_file_name(band)
    end

    it "contains no spaces" do
      expect(@filename).not_to match(/[ ]+/)
    end

    it "contains no symbols" do
      expect(@filename.gsub('.pdf', '')).not_to match(/[,.:!^'*\/\\]+/)
    end
  end
end