Removed sleep calls from acceptance tests, and instead started using Capybara built-in methods to wait for AJAX actions and the like to be finished making changes to the DOM. Work in progress.

Currently many tests fail.
Fixed acceptance tests related to folder management to work without ugly sleep hacks.
Got rid of all sleep calls in acceptance tests intended to solve timing problems.

Instead, proper calls to the Capybara API are done after any user action which can change the DOM. Capybara is very smart and waits for a time (10 seconds, configurable) for the change to actually happen in the DOM.

Also removed all assertions and even whole tests during acceptance testing that asserted against the database state (e.g. checking that a folder has been deleted from the database after some user action). This kind of checks have no place in acceptance tests, they belong to model unit tests. Actually all removed assertions were ALSO part of other model unit tests, and therefore were redundant.

Also made the database cleanup after each test a bit more smart. Sometimes user actions during acceptance testing trigger potentially long-running background actions that make changes in the database; e.g. when a user unsubscribes from a feed, it's possible that the app will decide to totally delete the feed, which in turn triggers a deletion of all its entries. In this case the acceptance test would finish as soon as the user unsubscribed from the feed and immediatelly database cleanup would happen, but the triggered deletions could still be running (but they would be running in the server thread, not in the user-agent thread, and so the acceptance test has no way of knowing if they are finished or not).

What would happen in this case is: the acceptance test would finish, RSpec would try to clean the database, and an error would be raised because the server thread is still doing the database deletions and SQLite is locked and cannot be cleaned.

To solve this, the logic that cleans up the database after each test is now a bit smarter. If an error is raised when trying to clean up the db, it sleeps for 1 second and retries the cleanup; this is done a maximum of 15 times before giving up and raising an error, which marks the test as failed. 15 seconds should be enough for all current acceptance tests, but this limit could be raised in the future if necessary.