docbrown/spec/services/follows/check_cached_spec.rb
Michael Kohl 5185de4c91
Move app/labor/follow_checker.rb to service (#11613)
* Move app/labor/follow_checker.rb to service

* Move to Follows:: namespace
2020-12-01 14:14:36 +07:00

16 lines
481 B
Ruby

require "rails_helper"
RSpec.describe Follows::CheckCached, type: :service do
let(:user) { create(:user) }
it "checks if following a thing and returns true if they are" do
user2 = create(:user)
user.follow(user2)
expect(described_class.call(user, "User", user2.id)).to eq(true)
end
it "checks if following a thing and returns false if they are not" do
user2 = create(:user)
expect(described_class.call(user, "User", user2.id)).to eq(false)
end
end