From b05d14dfcd50c1176ecfd765602ae34fd2c22dc0 Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Fri, 15 Apr 2022 09:44:14 -0500 Subject: [PATCH] Update builder spec variable names (#17302) * Update article builder spec In #16536 the tests were updated to match a change in the logic (rather than "needs authorization" the response was "store location", and we checked for those values). In #17294 we re-adjusted the meaning of the second returned value from Articles::Builder.call, and the call sites now label the second value as "needs_authorization" again. Restore the same name to the call sites in the spec, and simplify the example descriptions (this might be a mistake). * Restore long example descriptions This restores the names of the test cases to the original. --- spec/services/articles/builder_spec.rb | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/spec/services/articles/builder_spec.rb b/spec/services/articles/builder_spec.rb index ecb0261ab..2aa081c7b 100644 --- a/spec/services/articles/builder_spec.rb +++ b/spec/services/articles/builder_spec.rb @@ -19,12 +19,12 @@ RSpec.describe Articles::Builder, type: :service do } end - it "initializes an article with the correct attributes and does not store location" do - subject, store_location = described_class.call(user, tag, prefill) + it "initializes an article with the correct attributes and needs authorization" do + subject, needs_authorization = described_class.call(user, tag, prefill) expect(subject).to be_an_instance_of(Article) expect(subject).to have_attributes(correct_attributes) - expect(store_location).to be true + expect(needs_authorization).to be true end end @@ -38,12 +38,12 @@ RSpec.describe Articles::Builder, type: :service do } end - it "initializes an article with the correct attributes and does not store location" do - subject, store_location = described_class.call(user, tag, prefill) + it "initializes an article with the correct attributes and needs authorization" do + subject, needs_authorization = described_class.call(user, tag, prefill) expect(subject).to be_an_instance_of(Article) expect(subject).to have_attributes(correct_attributes) - expect(store_location).to be true + expect(needs_authorization).to be true end end @@ -60,12 +60,12 @@ RSpec.describe Articles::Builder, type: :service do } end - it "initializes an article with the correct attributes and does not store location" do - subject, store_location = described_class.call(user, tag, prefill) + it "initializes an article with the correct attributes and needs authorization" do + subject, needs_authorization = described_class.call(user, tag, prefill) expect(subject).to be_an_instance_of(Article) expect(subject).to have_attributes(correct_attributes) - expect(store_location).to be true + expect(needs_authorization).to be true end end @@ -79,12 +79,12 @@ RSpec.describe Articles::Builder, type: :service do } end - it "initializes an article with the correct attributes and does not store location" do - subject, store_location = described_class.call(user, tag, prefill) + it "initializes an article with the correct attributes and needs authorization" do + subject, needs_authorization = described_class.call(user, tag, prefill) expect(subject).to be_an_instance_of(Article) expect(subject).to have_attributes(correct_attributes) - expect(store_location).to be true + expect(needs_authorization).to be true end end @@ -99,13 +99,13 @@ RSpec.describe Articles::Builder, type: :service do } end - it "initializes an article with the correct attributes and stores location" do + it "initializes an article with the correct attributes and does not need authorization" do user.setting.update(editor_version: "v1") - subject, store_location = described_class.call(user, tag, prefill) + subject, needs_authorization = described_class.call(user, tag, prefill) expect(subject).to be_an_instance_of(Article) expect(subject).to have_attributes(correct_attributes) - expect(store_location).to be false + expect(needs_authorization).to be false end end @@ -117,12 +117,12 @@ RSpec.describe Articles::Builder, type: :service do } end - it "initializes an article with the correct attributes and does stores location" do - subject, store_location = described_class.call(user, tag, prefill) + it "initializes an article with the correct attributes and does not need authorization" do + subject, needs_authorization = described_class.call(user, tag, prefill) expect(subject).to be_an_instance_of(Article) expect(subject).to have_attributes(correct_attributes) - expect(store_location).to be false + expect(needs_authorization).to be false end end @@ -139,13 +139,13 @@ RSpec.describe Articles::Builder, type: :service do } end - it "initializes an article with the correct attributes and does stores location" do + it "initializes an article with the correct attributes and does not need authorization" do user.setting.update(editor_version: "v1") - subject, store_location = described_class.call(user, tag, prefill) + subject, needs_authorization = described_class.call(user, tag, prefill) expect(subject).to be_an_instance_of(Article) expect(subject).to have_attributes(correct_attributes) - expect(store_location).to be false + expect(needs_authorization).to be false end end end