Closed rstammer closed 10 years ago
The asset pipeline integration has been a challenge, because we usually need to talk to some not-exactly-meant-for-public-use interfaces in Rails. It sounds like one of these has broken down. If you can fix it, we're happy to take a pull, otherwise we'll have someone take a look at their soonest opportunity.
Thanks!
Thinking about this a little more, it's probably that the rails engine doesn't have the same sort of environment init that a regular rails app gets (which makes sense) ... I'm not sure if there's an easy way to support asset pipeline in Rails engines. You might have to put together a testing harness that includes a Rails app.
The engine already contains a dummy app located under /spec
which surely could be the host for the tests. I'm going to play with it to find a setup that works!
Short update: It's easy doing so and running the command from /spec/dummy
rake jasmine:ci JASMINE_CONFIG_PATH=../javascripts/support/jasmine.yml
This solves my practical problem for running it. Ideally it would be cool to run it from the engine's root directory natively like the rest of the test suite, but this way is okay.
edit: To make the command accessible, I had to add some code to the engines rakefile:
begin
require 'jasmine'
load 'jasmine/tasks/jasmine.rake'
rescue LoadError
task :jasmine do
abort "Jasmine is not available. In order to run jasmine, you must: (sudo) gem install jasmine"
end
end
I think we're not going to fix this since it looks like you have an appropriate workaround. We'd prefer not to have to offer direct support for Rails engines if it's significantly different from running w/ just Rails.
I installed the gem via the development dependency in the gemspec of a Rails4 engine on Ruby 2.0.0 and initialized it rails generator
rails g jasmine:install
.Starting the server works fine, but reloading the page on localhost:8888 in the browser or using
rake jasmine:ci
gives me the following 500:Did I miss something or is this maybe a deeper problem?