diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -175,7 +175,7 @@ RSpec.describe User, type: :model do
     end
 
     it 'will fail if the User is not persisted' do
-      expect { subject }.to raise_error(ActiveRecord::StatementInvalid)
+      expect { subject }.to raise_error(ActiveRecord::RecordNotSaved)
     end
 
     context "when another process makes the agent" do
Update test for error thrown by Rails <I>
The error thrown might have changed due to <URL>