* 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
11 lines
262 B
Ruby
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
|