spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
812 stars 256 forks source link

Strange url being generated in test mode #209

Open obromios opened 7 years ago

obromios commented 7 years ago

When I use tinymce in a ruby on rails app, in development, it works fine. However, when I run it in test mode, I get the following exception:

Failure/Error: raise ActionController::RoutingError, "No route matches [#{env['REQUEST_METHOD']}] #{env['PATH_INFO'].inspect}"

     ActionController::RoutingError:
       No route matches [GET] "/drills/https:/assets/tinymce/themes/modern/theme.js"

This only started after I upgrade to rails 5, before that, all tests associated with tinymce passed. I am using tinymce-rails 4.5.1.

On the relevant page, I have inserted the assets with <%= tinymce_assets %> and I also have on the same page <%= tinymce :drill %>, with the config/tinymce.yml file:

default:
  toolbar:
    - styleselect | bold italic | undo redo
    - image | link
  plugins:
    - image
    - link
drill:
  menubar: false
  toolbar:
    - styleselect | bold italic | undo redo | bullist | numlist | cut | copy | paste

If I take out the <%= tinymce :drill %>, the exception is no longer generated, but the test hangs at the line with the sleep in it;

 id = 'drill_description'
  expect(page).to have_css "##{id}"
  sleep 0.5 until page.evaluate_script("tinyMCE.get('#{id}') !== null")