docbrown/spec/services/articles/suggest_stickies_spec.rb
Jeremy Friesen 5430c2e203
Refactoring and documenting class (#15849)
* Refactoring and documenting class

I came to this commit by looking for raw `where` method calls to the
Article object.  Originally, I was looking at `where.not(user_id: :id)`
but found this service class.

In this class, I saw some significant duplication and went with a bit of
refactoring and some documentation.

This refactoring removed some unnecessary guards and calculations (as
documented inline).

* Naming a constant and adding more documentation
2022-01-03 09:30:41 -05:00

11 lines
262 B
Ruby

require "rails_helper"
RSpec.describe Articles::SuggestStickies, type: :services do
let(:article) { create(:article).decorate }
describe ".call" do
subject(:method_call) { described_class.call(article) }
it { is_expected.to be_a Array }
end
end