fix tests and fixes #2867
Merge pull request #2869 from digi604/fix-2867

fix tests and fixes #2867 (redirect preview only in edit mode)