Permalink
Browse files

Merge pull request #631 from jphpsf/fix-tests

Fixed a couple test related to asset loading
  • Loading branch information...
2 parents 945415c + 6e017e7 commit 8bef43e29a0d1d5aeb21fb5bf305a362b0a5e00b @jphpsf jphpsf committed Aug 3, 2011
Showing with 7 additions and 12 deletions.
  1. +2 −1 app/views/layouts/rails_admin/_footer.html.haml
  2. +5 −11 spec/requests/rails_admin_spec.rb
@@ -1,6 +1,7 @@
-# FIXME: the asset pipeline combined javascript (without jquery included) loads before the google CDN jquery,
-# so we end up with a jQuery undefined error. For now, I added jquery to the asset pipeline, but it's not ideal
--# as it might load jQuery twice (if the main application or another engine already loads it)
+-# as it might load jQuery twice (if the main application or another engine already loads it). Also remember to
+-# add that back to the tests in spec/requests/rails_admin_spec.rb as well.
-#= javascript_fallback "//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js", "/assets/javascripts/rails_admin/jquery-1.5.1.min.js", "typeof jQuery == 'undefined'"
-#= javascript_fallback "//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js", "/assets/javascripts/rails_admin/jquery-ui-1.8.14.min.js", "!jQuery.ui"
@@ -29,20 +29,14 @@
describe "html head" do
before { visit dashboard_path }
- # Note: the [href^="/sty... syntax matches the start of a value. The reason
+ # Note: the [href^="/asset... syntax matches the start of a value. The reason
# we just do that is to avoid being confused by rails' asset_ids.
- it "should load stylesheets" do
- should have_selector('link[href^="/stylesheets/rails_admin/ra.timeline.css"]')
+ it "should load stylesheets in header" do
+ should have_selector('head link[href^="/assets/rails_admin/rails_admin.css"]')
end
- it "should load javascript files" do
- scripts = %w[ /javascripts/rails_admin/application.js
- //ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js
- //ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js ]
-
- scripts.each do |script|
- should have_selector(%Q{script[src^="#{script}"]})
- end
+ it "should load javascript files in body" do
+ should have_selector('body script[src^="/assets/rails_admin/rails_admin.js"]')
end
end

0 comments on commit 8bef43e

Please sign in to comment.