mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Add failing specs for empty <link>
elements
This commit is contained in:
parent
5f5e246552
commit
2bb97b53bc
1 changed files with 26 additions and 0 deletions
|
@ -8,8 +8,10 @@ describe Agents::RssAgent do
|
|||
}
|
||||
|
||||
stub_request(:any, /github.com/).to_return(:body => File.read(Rails.root.join("spec/data_fixtures/github_rss.atom")), :status => 200)
|
||||
stub_request(:any, /bad.github.com/).to_return(body: File.read(Rails.root.join("spec/data_fixtures/github_rss.atom")).gsub(/<link [^>]+\/>/, '<link/>'), status: 200)
|
||||
stub_request(:any, /SlickdealsnetFP/).to_return(:body => File.read(Rails.root.join("spec/data_fixtures/slickdeals.atom")), :status => 200)
|
||||
stub_request(:any, /onethingwell.org/).to_return(body: File.read(Rails.root.join("spec/data_fixtures/onethingwell.rss")), status: 200)
|
||||
stub_request(:any, /bad.onethingwell.org/).to_return(body: File.read(Rails.root.join("spec/data_fixtures/onethingwell.rss")).gsub(/(?<=<link>)[^<]*/, ''), status: 200)
|
||||
end
|
||||
|
||||
let(:agent) do
|
||||
|
@ -257,6 +259,30 @@ describe Agents::RssAgent do
|
|||
event = agent.events.first
|
||||
expect(event.payload['authors']).to eq([])
|
||||
end
|
||||
|
||||
context 'with an empty link in RSS' do
|
||||
before do
|
||||
@valid_options['url'] = 'http://bad.onethingwell.org/rss'
|
||||
end
|
||||
|
||||
it "does not leak :no_buffer" do
|
||||
agent.check
|
||||
event = agent.events.first
|
||||
expect(event.payload['links']).to eq([])
|
||||
end
|
||||
end
|
||||
|
||||
context 'with an empty link in RSS' do
|
||||
before do
|
||||
@valid_options['url'] = "https://bad.github.com/cantino/huginn/commits/master.atom"
|
||||
end
|
||||
|
||||
it "does not leak :no_buffer" do
|
||||
agent.check
|
||||
event = agent.events.first
|
||||
expect(event.payload['links']).to eq([])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'logging errors with the feed url' do
|
||||
|
|
Loading…
Add table
Reference in a new issue