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