Reload target before checking smile count
This commit is contained in:
parent
4458aba37f
commit
d36fbf85f4
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue