Skip to content

Commit 542e049

Browse files
committed
Fix rubocop offenses
1 parent 3c7923b commit 542e049

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

spec/services/xml_generator/all_providers_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,44 +22,44 @@
2222
xml = subject.perform
2323
doc = Nokogiri::XML(xml)
2424

25-
[provider1, provider2].each do |prov|
25+
[ provider1, provider2 ].each do |prov|
2626
pnode = doc.at_xpath("//cmes/content_provider[@name='#{prov.name}']")
2727
expect(pnode).to be_present
2828
end
2929

30-
[[provider1, topic1], [provider2, topic2]].each do |prov, topic|
30+
[ [ provider1, topic1 ], [ provider2, topic2 ] ].each do |prov, topic|
3131
pnode = doc.at_xpath("//cmes/content_provider[@name='#{prov.name}']")
3232
year = topic.published_at.year
3333
ynode = pnode.at_xpath("./topic_year[@year='#{year}']")
3434
expect(ynode).to be_present
3535

36-
month_label = topic.published_at.strftime('%m_%B')
36+
month_label = topic.published_at.strftime("%m_%B")
3737
mnode = ynode.at_xpath("./topic_month[@month='#{month_label}']")
3838
expect(mnode).to be_present
3939

4040
tnode = mnode.at_xpath("./title[@name='#{topic.title}']")
4141
expect(tnode).to be_present
4242

43-
expect(tnode.at_xpath('./topic_id').text).to eq(topic.id.to_s)
44-
expect(tnode.at_xpath('./counter').text).to eq('0')
45-
expect(tnode.at_xpath('./topic_volume').text).to eq(topic.published_at.year.to_s)
46-
expect(tnode.at_xpath('./topic_issue').text).to eq(topic.published_at.month.to_s)
43+
expect(tnode.at_xpath("./topic_id").text).to eq(topic.id.to_s)
44+
expect(tnode.at_xpath("./counter").text).to eq("0")
45+
expect(tnode.at_xpath("./topic_volume").text).to eq(topic.published_at.year.to_s)
46+
expect(tnode.at_xpath("./topic_issue").text).to eq(topic.published_at.month.to_s)
4747

4848
files = tnode.at_xpath("./topic_files[@files='Files']")
4949
expect(files).to be_present
50-
if topic.documents.attached? && topic.documents.reject { |d| d.content_type == 'video/mp4' }.any?
50+
if topic.documents.attached? && topic.documents.reject { |d| d.content_type == "video/mp4" }.any?
5151
first_file = files.element_children.first
5252
expect(first_file).to be_present
5353
expect(first_file.text).to be_present
54-
expect(first_file['file_size']).to be_present
54+
expect(first_file["file_size"]).to be_present
5555
else
5656
expect(files.element_children).to be_empty
5757
end
5858

59-
author1 = tnode.at_xpath('./topic_author/topic_author_1')
60-
expect(author1.text).to eq(' ')
59+
author1 = tnode.at_xpath("./topic_author/topic_author_1")
60+
expect(author1.text).to eq(" ")
6161

62-
expect(tnode.at_xpath('./topic_tags').text).to eq(topic.current_tags_list.join(', '))
62+
expect(tnode.at_xpath("./topic_tags").text).to eq(topic.current_tags_list.join(", "))
6363
end
6464
end
6565
end

spec/services/xml_generator/single_provider_spec.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,34 @@
3636
xml = subject.perform
3737
doc = Nokogiri::XML(xml)
3838

39-
provider_node = doc.at_xpath("//cmes/content_provider[@name='#{provider.name}']")
39+
provider_node = doc.at_xpath("//cmes/content_provider[@name='#{provider.name}']")
4040
expect(provider_node).to be_present
4141

42-
year_node = provider_node.at_xpath("./topic_year[@year='#{topic.published_at.year}']")
42+
year_node = provider_node.at_xpath("./topic_year[@year='#{topic.published_at.year}']")
4343
expect(year_node).to be_present
4444

45-
month_label = topic.published_at.strftime("%m_%B")
46-
month_node = year_node.at_xpath("./topic_month[@month='#{month_label}']")
45+
month_label = topic.published_at.strftime("%m_%B")
46+
month_node = year_node.at_xpath("./topic_month[@month='#{month_label}']")
4747
expect(month_node).to be_present
4848

49-
title_node = month_node.at_xpath("./title[@name='#{topic.title}']")
49+
title_node = month_node.at_xpath("./title[@name='#{topic.title}']")
5050
expect(title_node).to be_present
5151

52-
expect(title_node.at_xpath('./topic_id').text).to eq(topic.id.to_s)
53-
expect(title_node.at_xpath('./counter').text).to eq('0')
54-
expect(title_node.at_xpath('./topic_volume').text).to eq(topic.published_at.year.to_s)
55-
expect(title_node.at_xpath('./topic_issue').text).to eq(topic.published_at.month.to_s)
52+
expect(title_node.at_xpath("./topic_id").text).to eq(topic.id.to_s)
53+
expect(title_node.at_xpath("./counter").text).to eq("0")
54+
expect(title_node.at_xpath("./topic_volume").text).to eq(topic.published_at.year.to_s)
55+
expect(title_node.at_xpath("./topic_issue").text).to eq(topic.published_at.month.to_s)
5656

57-
files_node = title_node.at_xpath("./topic_files[@files='Files']")
57+
files_node = title_node.at_xpath("./topic_files[@files='Files']")
5858
expect(files_node).to be_present
59-
file1 = files_node.at_xpath('./file_name_1')
60-
expect(file1.text).to eq('test_image.png')
61-
expect(file1['file_size']).to be_present
59+
file1 = files_node.at_xpath("./file_name_1")
60+
expect(file1.text).to eq("test_image.png")
61+
expect(file1["file_size"]).to be_present
6262

63-
author_node = title_node.at_xpath('./topic_author/topic_author_1')
64-
expect(author_node.text).to eq(' ')
63+
author_node = title_node.at_xpath("./topic_author/topic_author_1")
64+
expect(author_node.text).to eq(" ")
6565

66-
expect(title_node.at_xpath('./topic_tags').text).to eq(topic.current_tags_list.join(', '))
66+
expect(title_node.at_xpath("./topic_tags").text).to eq(topic.current_tags_list.join(", "))
6767
end
6868
end
6969
end

0 commit comments

Comments
 (0)