|
12 | 12 | let(:global_config) do |
13 | 13 | { |
14 | 14 | 'headers' => { |
15 | | - 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:67.0) Gecko/20100101 Firefox/67.0' |
| 15 | + 'User-Agent': <<~UA.delete("\n") |
| 16 | + Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) |
| 17 | + AppleWebKit/537.36 (KHTML, like Gecko) |
| 18 | + Chrome/134.0.0.0 |
| 19 | + Safari/537.36' |
| 20 | + UA |
16 | 21 | } |
17 | 22 | } |
18 | 23 | end |
19 | 24 | let(:config) do |
20 | 25 | feed_name = file_path.split(File::Separator)[-2..].join(File::Separator) |
21 | 26 | config = {}.merge Html2rss::Configs.find_by_name(feed_name) |
22 | 27 |
|
23 | | - config.merge!(global_config) |
| 28 | + config.merge!(global_config.dup) |
24 | 29 | config[:params] = params if params |
25 | 30 | config |
26 | 31 | end |
|
63 | 68 | end |
64 | 69 | end |
65 | 70 |
|
66 | | - context 'with sanitize_html post_processor' do |
67 | | - it 'is used for description selector' do |
68 | | - if (description_selector = yaml['selectors']['description']) |
69 | | - post_processors = [description_selector['post_process']].flatten.compact |
70 | | - sanitize_html = post_processors.select { |p| p['name'] == 'sanitize_html' } |
71 | | - |
72 | | - expect(sanitize_html).not_to be_nil |
73 | | - end |
74 | | - end |
75 | | - end |
76 | | - |
77 | 71 | context 'with template post_processor' do |
78 | 72 | it 'references available selectors only', :aggregate_failures do |
79 | 73 | Helper.referenced_selectors_in_template(yaml['selectors']).each do |referenced_selector| |
|
97 | 91 | end |
98 | 92 |
|
99 | 93 | context "when fetching #{params}", :fetch do |
100 | | - subject(:feed) { Html2rss.feed(config) } |
| 94 | + subject(:feed) { Html2rss.feed(config.dup) } |
101 | 95 |
|
102 | 96 | it 'has positive amount of items' do |
103 | 97 | expect(feed.items.count).to be_positive, <<~MSG |
|
115 | 109 |
|
116 | 110 | context "when fetching #{params} / item", :fetch do |
117 | 111 | subject(:item) do |
118 | | - items = Html2rss.feed(config).items |
| 112 | + items = Html2rss.feed(config.dup).items |
119 | 113 |
|
120 | 114 | expect(items.count).not_to be_zero, "Zero items fetched for `#{file_name}`" |
121 | 115 |
|
|
0 commit comments