Skip to content

Commit

Permalink
Fixed a couple more tests related to asset loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jphpsf committed Aug 3, 2011
1 parent 945415c commit 6e017e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
3 changes: 2 additions & 1 deletion app/views/layouts/rails_admin/_footer.html.haml
@@ -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"
Expand Down
16 changes: 5 additions & 11 deletions spec/requests/rails_admin_spec.rb
Expand Up @@ -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

Expand Down

0 comments on commit 6e017e7

Please sign in to comment.