question/create_followers: fix incrementing asked_count
This commit is contained in:
parent
9b5470cfd3
commit
9d38292d4a
|
@ -29,7 +29,7 @@ module UseCase
|
|||
private
|
||||
|
||||
def increment_asked_count
|
||||
source_user.increment(:asked_count)
|
||||
source_user.increment!(:asked_count)
|
||||
end
|
||||
|
||||
def source_user
|
||||
|
|
|
@ -23,5 +23,9 @@ describe UseCase::Question::CreateFollowers do
|
|||
it "enqueues a QuestionWorker job" do
|
||||
expect(QuestionWorker).to have_enqueued_sidekiq_job(source_user.id, subject[:resource].id)
|
||||
end
|
||||
|
||||
it "increments the asked count" do
|
||||
expect { subject }.to change { source_user.reload.asked_count }.by(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue