Use tap instead of a temporary variable to modify after create (#15453)

This commit is contained in:
Daniel Uber 2021-11-22 16:06:11 -06:00 committed by GitHub
parent b7246a5ef0
commit 33757683ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,9 +2,9 @@ require "rails_helper"
RSpec.describe Feeds::AssembleArticleMarkdown, type: :service do
let(:user) do
u = create(:user)
u.setting.update(feed_mark_canonical: true)
u
create(:user).tap do |u|
u.setting.update(feed_mark_canonical: true)
end
end
let(:feed_source_url) { "https://feed.source/url" }
let(:feed) { instance_double("Feedjira::Parser::RSS", url: "https://feed.source/") }