Use :loose option with feed-normalizer for now

jermie 9 gadi atpakaļ
vecāks
revīzija
522d288326
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 1 1
      app/models/agents/rss_agent.rb
  2. 1 1
      spec/models/agents/rss_agent_spec.rb

+ 1 - 1
app/models/agents/rss_agent.rb

@@ -97,7 +97,7 @@ module Agents
97 97
     def check_url(url)
98 98
       response = faraday.get(url)
99 99
       if response.success?
100
-        feed = FeedNormalizer::FeedNormalizer.parse(response.body)
100
+        feed = FeedNormalizer::FeedNormalizer.parse(response.body, :loose => true)
101 101
         feed.clean! if boolify(interpolated['clean'])
102 102
         max_events = (interpolated['max_events_per_run'].presence || 0).to_i
103 103
         created_event_count = 0

+ 1 - 1
spec/models/agents/rss_agent_spec.rb

@@ -151,7 +151,7 @@ describe Agents::RssAgent do
151 151
 
152 152
   describe 'logging errors with the feed url' do
153 153
     it 'includes the feed URL when an exception is raised' do
154
-      mock(FeedNormalizer::FeedNormalizer).parse(anything) { raise StandardError.new("Some error!") }
154
+      mock(FeedNormalizer::FeedNormalizer).parse(anything, :loose => true) { raise StandardError.new("Some error!") }
155 155
       expect(lambda {
156 156
         agent.check
157 157
       }).not_to raise_error