Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration tests for assets #2806

Merged
merged 3 commits into from
Jun 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
class AdminController < ApplicationController
before_action :require_user, only: %i(spam spam_revisions mark_comment_spam publish_comment)

# intended to provide integration tests for assets
def assets
end

def promote_admin
@user = User.find params[:id]
Expand Down
48 changes: 48 additions & 0 deletions app/views/admin/assets.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<%= javascript_include_tag 'leaflet-blurred-location/dist/Leaflet.BlurredLocation' %>

<%= javascript_include_tag 'application' %>
<%= javascript_include_tag 'advanced_search' %>
<%= javascript_include_tag 'comment_expand' %>
<%= javascript_include_tag 'dashboard' %>
<%= javascript_include_tag 'dragdrop' %>
<%= javascript_include_tag 'dynamic_search' %>
<%= javascript_include_tag 'editor' %>
<%= javascript_include_tag 'graph' %>
<%= javascript_include_tag 'grids' %>
<%= javascript_include_tag 'header_footer' %>
<%= javascript_include_tag 'ics.deps.min' %>
<%= javascript_include_tag 'ics.min' %>
<%= javascript_include_tag 'jsdiff' %>
<%= javascript_include_tag 'leaflet_helper' %>
<%= javascript_include_tag 'like' %>
<%= javascript_include_tag 'locationForm' %>
<%= javascript_include_tag 'main_image' %>
<%= javascript_include_tag 'methods' %>
<%= javascript_include_tag 'notes' %>
<%= javascript_include_tag 'post' %>
<%= javascript_include_tag 'question' %>
<%= javascript_include_tag 'restful_typeahead' %>
<%= javascript_include_tag 'searchform' %>
<%= javascript_include_tag 'setup' %>
<%= javascript_include_tag 'sidebar' %>
<%= javascript_include_tag 'tagging' %>
<%= javascript_include_tag 'textbox_expand' %>
<%= javascript_include_tag 'users' %>
<%= javascript_include_tag 'wikis' %>

<%= stylesheet_link_tag 'blog' %>
<%= stylesheet_link_tag 'comments' %>
<%= stylesheet_link_tag 'dashboard' %>
<%= stylesheet_link_tag 'editor' %>
<%= stylesheet_link_tag 'fancy' %>
<%= stylesheet_link_tag 'feature' %>
<%= stylesheet_link_tag 'I18n' %>
<%= stylesheet_link_tag 'location_tags' %>
<%= stylesheet_link_tag 'map' %>
<%= stylesheet_link_tag 'print' %>
<%= stylesheet_link_tag 'question' %>
<%= stylesheet_link_tag 'search' %>
<%= stylesheet_link_tag 'style' %>
<%= stylesheet_link_tag 'tags' %>
<%= stylesheet_link_tag 'user_tags.' %>
<%= stylesheet_link_tag 'wiki' %>
52 changes: 51 additions & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1 +1,51 @@
Rails.application.config.assets.precompile += %w( print.css I18n.css sidebar.js dashboard.css dashboard.js dragdrop.js methods.js post.js comment_expand.js leaflet-blurred-location/dist/Leaflet.BlurredLocation.js dynamic_search.js notes.js textbox_expand.js question.js )
Rails.application.config.assets.precompile += [
'leaflet-blurred-location/dist/Leaflet.BlurredLocation.js',

'advanced_search.js',
'application.js',
'comment_expand.js',
'dashboard.js',
'dragdrop.js',
'dynamic_search.js',
'editor.js',
'graph.js',
'grids.js',
'header_footer.js',
'ics.deps.min.js',
'ics.min.js',
'jsdiff.js',
'leaflet_helper.js',
'like.js',
'locationForm.js',
'main_image.js',
'methods.js',
'notes.js',
'post.js',
'question.js',
'restful_typeahead.js',
'searchform.js',
'setup.js',
'sidebar.js',
'tagging.js',
'textbox_expand.js',
'users.js',
'wikis.js',

'blog.css',
'comments.css',
'dashboard.css',
'editor.css',
'fancy.css',
'feature.css',
'I18n.css',
'location_tags.css.scss',
'map.css',
'print.css',
'question.css',
'search.css',
'style.css',
'tags.css',
'user_tags.css.scss',
'wiki.css'
]

2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
end

get '/change_locale/:locale', to: 'settings#change_locale', as: :change_locale
get 'ioby' => "legacy#ioby"
get 'assets' => "admin#assets"

get 'login' => "user_sessions#new", :as => :login
get 'logout' => "user_sessions#destroy", :as => :logout
Expand Down
5 changes: 5 additions & 0 deletions test/integration/public_pages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ def setup
get nodes(:question).path(:question)
assert_response :success
end

test 'assets tests' do
get '/assets'
assert_response :success
end
end