Reload target before checking smile count

This commit is contained in:
Karina Kwiatek 2023-10-29 20:42:37 +01:00 committed by Andreas Nedbal
parent 4458aba37f
commit d36fbf85f4
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ require "rails_helper"
describe UseCase::Reaction::Create do
shared_examples_for "valid target type" do
it "creates a reaction" do
expect { subject }.to change { target.smile_count }.by(1)
expect { subject }.to change { target.reload.smile_count }.by(1)
end
end

View File

@ -9,7 +9,7 @@ describe UseCase::Reaction::Destroy do
end
it "destroys a reaction" do
expect { subject }.to change { target.smile_count }.by(-1)
expect { subject }.to change { target.reload.smile_count }.by(-1)
end
end