Merge pull request #352 from AyuntamientoMadrid/turbolink-ckeditor

Fixes CKeditor & Turbolinks issue
This commit is contained in:
Raimond Garcia
2015-09-04 14:11:34 +02:00
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
$(document).bind('page:change', function() {
if (typeof(CKEDITOR) != "undefined"){
for(name in CKEDITOR.instances){
try{CKEDITOR.replace(name);}catch(err){};
}
}
});

View File

@@ -69,6 +69,20 @@ feature 'Debates' do
expect(page).to have_content I18n.l(Debate.last.created_at.to_date)
end
scenario 'CKEditor is present before & after turbolinks update page', :js do
author = create(:user)
login_as(author)
visit new_debate_path
expect(page).to have_css "#cke_debate_description"
click_link 'Debates'
click_link 'Start a debate'
expect(page).to have_css "#cke_debate_description"
end
scenario 'Captcha is required for debate creation' do
login_as(create(:user))