Skip to content

Commit

Permalink
[B] Replace invalid chars in gdoc ingestion
Browse files Browse the repository at this point in the history
[Fixes #409]
  • Loading branch information
SMaxOwok authored and zdavis committed Jun 28, 2017
1 parent 9f84e05 commit 60c08b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion api/app/services/ingestor/strategy/google_doc/strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def self.inspector(ingestion, pointer)

def fetch(pointer)
contents = self.class.session.drive.export_file(pointer.id, "text/html")
@ingestion.write("index.html", contents)
encoded_contents = contents.encode("utf-8", invalid: :replace, undef: :replace)
@ingestion.write("index.html", encoded_contents)
self
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
expect(@text.page_list).to eq []
end

it "has no stylesheets" do
expect(@text.stylesheets.length).to eq 0
it "has one stylesheet" do
expect(@text.stylesheets.length).to eq 1
end

it "has one entry in the spine" do
Expand All @@ -49,7 +49,7 @@
expect(@text.text_sections.length).to eq 1
end

it "has ond ingestion sources" do
it "has one ingestion sources" do
expect(@text.ingestion_sources.length).to eq 1
end

Expand Down

0 comments on commit 60c08b5

Please sign in to comment.