|
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 | + # 'Accept-Encoding': 'gzip, deflate, br, zstd', |
| 16 | + 'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8,de;q=0.7', |
| 17 | + # Host: 'httpbin.org', |
| 18 | + Priority: 'u=1, i', |
| 19 | + # Referer: 'https://httpbin.org/', |
| 20 | + 'Sec-Ch-Ua': '"Chromium";v="134", "Not:A-Brand";v="24", "Google Chrome";v="134"', |
| 21 | + 'Sec-Ch-Ua-Mobile': '?0', |
| 22 | + 'Sec-Ch-Ua-Platform': '"macOS"', |
| 23 | + 'Sec-Fetch-Dest': 'empty', |
| 24 | + 'Sec-Fetch-Mode': 'cors', |
| 25 | + 'Sec-Fetch-Site': 'same-origin', |
| 26 | + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36' |
16 | 27 | } |
17 | 28 | } |
18 | 29 | end |
19 | 30 | let(:config) do |
20 | 31 | feed_name = file_path.split(File::Separator)[-2..].join(File::Separator) |
21 | 32 | config = {}.merge Html2rss::Configs.find_by_name(feed_name) |
22 | 33 |
|
23 | | - config.merge!(global_config) |
| 34 | + config.merge!(global_config.dup) |
24 | 35 | config[:params] = params if params |
25 | 36 | config |
26 | 37 | end |
|
63 | 74 | end |
64 | 75 | end |
65 | 76 |
|
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 | 77 | context 'with template post_processor' do |
78 | 78 | it 'references available selectors only', :aggregate_failures do |
79 | 79 | Helper.referenced_selectors_in_template(yaml['selectors']).each do |referenced_selector| |
|
97 | 97 | end |
98 | 98 |
|
99 | 99 | context "when fetching #{params}", :fetch do |
100 | | - subject(:feed) { Html2rss.feed(config) } |
| 100 | + subject(:feed) { Html2rss.feed(config.dup) } |
101 | 101 |
|
102 | 102 | it 'has positive amount of items' do |
103 | 103 | expect(feed.items.count).to be_positive, <<~MSG |
|
115 | 115 |
|
116 | 116 | context "when fetching #{params} / item", :fetch do |
117 | 117 | subject(:item) do |
118 | | - items = Html2rss.feed(config).items |
| 118 | + items = Html2rss.feed(config.dup).items |
119 | 119 |
|
120 | 120 | expect(items.count).not_to be_zero, "Zero items fetched for `#{file_name}`" |
121 | 121 |
|
|
0 commit comments