Permalink
Browse files

Fix RuboCop offenses

  • Loading branch information...
mvz committed Jun 18, 2017
1 parent 027782b commit b7c0040ba384cd84567e45e625ff2ca027b628e6
View
@@ -68,7 +68,7 @@ Style/Documentation:
# Provides more information, while still being displayable in modern wide-screen.
Metrics/LineLength:
Max: 120
Max: 100
# Allow the use of 'and' 'or' in control structures.
Style/AndOr:
@@ -14,15 +14,15 @@
context 'with atom format' do
before(:each) { get 'index', params: { format: 'atom' } }
it "responds with success" do
it 'responds with success' do
expect(response).to be_success
end
it "assigns all feedback" do
it 'assigns all feedback' do
expect(assigns(:feedback)).to match_array items
end
it "renders the index template" do
it 'renders the index template' do
expect(response).to render_template('feedback/index')
end
@@ -36,23 +36,23 @@
it 'renders each item with the correct template' do
expect(response).
to render_template(partial: 'shared/_atom_item_comment', count: 2).
and render_template(partial: 'shared/_atom_item_trackback', count: 2)
and render_template(partial: 'shared/_atom_item_trackback', count: 2)
end
end
end
context 'with rss format' do
before { get 'index', params: { format: 'rss' } }
it "responds with success" do
it 'responds with success' do
expect(response).to be_success
end
it "assigns all feedback" do
it 'assigns all feedback' do
expect(assigns(:feedback)).to match_array items
end
it "renders the index template" do
it 'renders the index template' do
expect(response).to render_template('feedback/index')
end
@@ -66,7 +66,7 @@
it 'renders each item with the correct template' do
expect(response).
to render_template(partial: 'shared/_rss_item_comment', count: 2).
and render_template(partial: 'shared/_rss_item_trackback', count: 2)
and render_template(partial: 'shared/_rss_item_trackback', count: 2)
end
end
end
@@ -43,9 +43,9 @@
to eq "Trackback from #{trackback.blog_name}: #{trackback.title} on #{article.title}"
expect(rendered_entry.entry_id).to eq('urn:uuid:dsafsadffsdsf')
expect(rendered_entry.summary).to eq('This is an excerpt')
expect(rendered_entry.links.first).to eq("#{article.permalink_url}#trackback-#{trackback.id}")
expect(rendered_entry.links.first).
to eq("#{article.permalink_url}#trackback-#{trackback.id}")
end
end
end
end
@@ -3,7 +3,12 @@
RSpec.describe 'feedback/index.rss.builder', type: :view do
describe 'rendering feedback' do
let(:article) { build_stubbed :article }
let(:comment) { build_stubbed(:comment, article: article, body: 'Comment body', guid: '12313123123123123') }
let(:comment) do
build_stubbed(:comment,
article: article,
body: 'Comment body',
guid: '12313123123123123')
end
let(:trackback) { build_stubbed(:trackback, article: article) }
before(:each) do
@@ -23,7 +28,8 @@
expect(rendered_entry.title).to eq "Comment on #{article.title} by #{comment.author}"
expect(rendered_entry.entry_id).to eq('urn:uuid:12313123123123123')
expect(rendered_entry.summary).to eq('<p>Comment body</p>')
expect(xml_entry.css('link').first.content).to eq("#{article.permalink_url}#comment-#{comment.id}")
expect(xml_entry.css('link').first.content).
to eq("#{article.permalink_url}#comment-#{comment.id}")
end
end
@@ -32,12 +38,12 @@
let(:xml_entry) { Nokogiri::XML.parse(rendered).css('item').last }
it 'should have all the required attributes' do
expect(rendered_entry.title).to eq "Trackback from #{trackback.blog_name}: #{trackback.title} on #{article.title}"
expect(rendered_entry.title).
to eq "Trackback from #{trackback.blog_name}: #{trackback.title} on #{article.title}"
expect(rendered_entry.entry_id).to eq('urn:uuid:dsafsadffsdsf')
expect(rendered_entry.summary).to eq('This is an excerpt')
expect(xml_entry.css('link').first.content).to eq(trackback.url)
end
end
end
end

0 comments on commit b7c0040

Please sign in to comment.