Skip to content

Commit

Permalink
Add test for filename option
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenperera committed May 3, 2017
1 parent 3ed008c commit 3512a83
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/pdf_generator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ defmodule PdfGeneratorTest do
|> assert
end

test "generate! with filename option returns custom filename" do
filename = PdfGenerator.generate!(@html, filename: "custom_file_name")
assert File.exists?(filename)
assert Path.basename(filename, ".pdf") == "custom_file_name"
end

test "generate_binary! reads file" do
assert "%PDF-1" <> _pdf = @html |> PdfGenerator.generate_binary!
end
Expand Down

0 comments on commit 3512a83

Please sign in to comment.