The touch process in 'belongs_to :supplier, class_name: 'Enterprise', touch: true' must have changed in rails 4 and now we need to reload the enterprise to get the new updated_at value

This commit is contained in:
Luis Ramos
2020-03-03 12:26:18 +00:00
parent 829a73c58d
commit ba750547a2

View File

@@ -33,7 +33,7 @@ describe Enterprise do
it "touches enterprise when the supplier of a product changes" do
expect {
product.update_attributes!(supplier: supplier2)
}.to change { enterprise.updated_at }
}.to change { enterprise.reload.updated_at }
end
end