|
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': '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 | 16 | } |
17 | 17 | } |
18 | 18 | end |
19 | 19 | let(:config) do |
20 | 20 | feed_name = file_path.split(File::Separator)[-2..].join(File::Separator) |
21 | 21 | config = {}.merge Html2rss::Configs.find_by_name(feed_name) |
22 | 22 |
|
23 | | - config.merge!(global_config) |
| 23 | + config.merge!(global_config.dup) |
24 | 24 | config[:params] = params if params |
25 | 25 | config |
26 | 26 | end |
|
63 | 63 | end |
64 | 64 | end |
65 | 65 |
|
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 | 66 | context 'with template post_processor' do |
78 | 67 | it 'references available selectors only', :aggregate_failures do |
79 | 68 | Helper.referenced_selectors_in_template(yaml['selectors']).each do |referenced_selector| |
|
97 | 86 | end |
98 | 87 |
|
99 | 88 | context "when fetching #{params}", :fetch do |
100 | | - subject(:feed) { Html2rss.feed(config) } |
| 89 | + subject(:feed) { Html2rss.feed(config.dup) } |
101 | 90 |
|
102 | 91 | it 'has positive amount of items' do |
103 | 92 | expect(feed.items.count).to be_positive, <<~MSG |
|
115 | 104 |
|
116 | 105 | context "when fetching #{params} / item", :fetch do |
117 | 106 | subject(:item) do |
118 | | - items = Html2rss.feed(config).items |
| 107 | + items = Html2rss.feed(config.dup).items |
119 | 108 |
|
120 | 109 | expect(items.count).not_to be_zero, "Zero items fetched for `#{file_name}`" |
121 | 110 |
|
|
0 commit comments