ActiveRecord throws SQLException in Rspec test

UPDATE: My problem is definitely related to this - this is a problem with ActiveRecord. Still not resolved.

I am trying to pass a test in rspec and cannot figure out what will go wrong ... Here is what I get:

Running: spec/models/user_spec.rb
.
.
.
........F

Failures:

  1) User when email address is already taken 
     Failure/Error: user_with_same_email.save
     ActiveRecord::StatementInvalid:
     SQLite3::SQLException: near "SAVEPOINT": 
     syntax error: SAVEPOINT active_record_1
     # ./spec/models/user_spec.rb:64:in `block (3 levels) in <top (required)>'

Finished in 0.22908 seconds
9 examples, 1 failure

Here is the corresponding line in my test:

user_with_same_email.save

it breaks when trying to write to db. Development is fine - no problem. Thanks

+3
source share
1 answer

The problem was the old version of sqlite. I installed Homebrew and started. brew install sqlite3 Due to existing files, several errors appeared. I just renamed them *.oldand started brew link sqlite3. The problem is solved!

+2
source

All Articles