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.
This commit is contained in:
parent
16c49a5df2
commit
b05d14dfcd
1 changed files with 21 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue