Merge pull request #352 from AyuntamientoMadrid/turbolink-ckeditor
Fixes CKeditor & Turbolinks issue
This commit is contained in:
7
app/assets/javascripts/ckeditor/reinit.js
Normal file
7
app/assets/javascripts/ckeditor/reinit.js
Normal 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){};
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user