Merge pull request #3998 from rockandror/ckeditor-browser-history-back
Destroy and intialize ckeditor on browser history back
This commit is contained in:
@@ -51,4 +51,20 @@ describe "CKEditor" do
|
||||
expect(page).not_to have_link "Upload"
|
||||
expect(page).not_to have_link "Browse Server"
|
||||
end
|
||||
|
||||
context "When navigating back to editor page using browser history back" do
|
||||
scenario "display ckeditor unsaved contents", :js do
|
||||
login_as(create(:administrator).user)
|
||||
|
||||
visit new_admin_newsletter_path
|
||||
fill_in_ckeditor "Email content", with: "This is an unsaved body"
|
||||
click_link "Newsletters"
|
||||
|
||||
expect(page).to have_link "New newsletter"
|
||||
|
||||
go_back
|
||||
|
||||
expect(page).to have_ckeditor "Email content", with: "This is an unsaved body"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user