standardnotes / syncing-server

[Deprecated: Use our new Node server: https://github.com/standardnotes/syncing-server-js]
https://standardnotes.org
GNU Affero General Public License v3.0
209 stars 48 forks source link

Reimplement Failing test #53

Closed karolsojko closed 4 years ago

karolsojko commented 4 years ago

One test is failing on a fresh local filesystem setup and CI. It was marked as skipped in this PR https://github.com/standardnotes/syncing-server/pull/52 and should be reimplemented in a different fashion.

Error output from the test run:

.......................Not enough or too many segments

..............................FUnable to disable MFA; user has email recovery disabled.

.MFA has been disabled.

...Successfully disabled email backups.

..

Failures:

  1) User download_backup 

     Failure/Error: File.open("tmp/#{email}-restore.txt", 'w') { |file| file.write(body) }

     Errno::ENOENT:

       No such file or directory @ rb_sysopen - tmp/sn@testing.com-restore.txt

     # ./app/models/user.rb:37:in `initialize'

     # ./app/models/user.rb:37:in `open'

     # ./app/models/user.rb:37:in `download_backup'

     # ./spec/models/user_spec.rb:113:in `block (3 levels) in <top (required)>'

Finished in 9.01 seconds (files took 2.48 seconds to load)

60 examples, 1 failure

cc @johnny243

johnny243 commented 4 years ago

The test is failing because the tmp directory does not exists. Said directory is created automatically when the rails server is started.

https://github.com/standardnotes/syncing-server/blob/857d79abc9b8493b81ae3b99161e1d5256ec753e/app/models/user.rb#L37

I'll come up with a fix soon.