diff --git a/Gemfile b/Gemfile index d22621df..70a83485 100644 --- a/Gemfile +++ b/Gemfile @@ -9,12 +9,17 @@ group :development, :test do gem 'pry-byebug' unless ENV['CI'] end -# We allow testing under multiple versions of Rails by setting ENV RAILS_VERSION, -# used in CI, can be used locally too. Make sure to delete your Gemfile.lock after -# changing a local RAILS_VERSION +# == Extra dependencies for dummy test app == +# +# Extra dependencies for dummy test app are in .gemspec as a development dependency +# where possible. But when dependencies vary for different versions +# of Rails, rails-version-specific dependencies are here, behind conditionals, for now. # # TODO switch to use appraisal gem instead, encapsulating these different additional # dependencies per Rails version, as well as method of choosing operative rails version. +# +# We allow testing under multiple versions of Rails by setting ENV RAILS_VERSION, +# used in CI, can be used locally too. # Set a default RAILS_VERSION so we make sure to get extra dependencies for it... @@ -44,7 +49,6 @@ if ENV['RAILS_VERSION'] gem "mail", ">= 2.8.0.rc1" when /^6\.0\./ gem 'sass-rails', '>= 6' - gem 'webpacker', '~> 4.0' when /^5\.[12]\./ gem 'sass-rails', '~> 5.0' gem 'sprockets', '~> 3.7' diff --git a/README.md b/README.md index 62a44421..ba76745e 100644 --- a/README.md +++ b/README.md @@ -284,9 +284,7 @@ Or individually, `bundle exec rubocop`, `bundle exec rspec`. You can test with different versions of rails by setting ENV variable `RAILS_VERSION` to a specific version like `"6.1.2"` or `"7.0.0"`, perhaps by `export RAILS_ENV=7.0.0` to set it in your shell session. -Tests by default will be run with bootstrap-4 integration. You can test with bootstrap-3 by setting ENV varaible `TEST_BOOTSTRAP=3`. - -After changing `RAILS_VERSION` or `TEST_BOOTSTRAP` you may have to run `rm Gemfile.lock` and `bundle install` again. If you get a `Bundler could not find compatible versions...` error, for instance. +After changing `RAILS_VERSION` you may have to run `rm Gemfile.lock` and `bundle install` again. If you get a `Bundler could not find compatible versions...` error, for instance. # Help diff --git a/browse-everything.gemspec b/browse-everything.gemspec index 19d3a220..b6250ddd 100644 --- a/browse-everything.gemspec +++ b/browse-everything.gemspec @@ -29,11 +29,17 @@ Gem::Specification.new do |spec| spec.add_dependency 'signet', '~> 0.8' spec.add_dependency 'typhoeus' + # Development dependencies include dependencies necessary for running + # the dummy test app at ./spec/dummy_test_app + spec.add_development_dependency 'bixby', '~> 5.0' + spec.add_development_dependency 'bootstrap', "~> 4.0" # we do not support bootstrap 5 spec.add_development_dependency 'bundler', '>= 1.3' spec.add_development_dependency 'capybara' spec.add_development_dependency 'factory_bot_rails' + spec.add_development_dependency 'jquery-rails' spec.add_development_dependency 'pry-byebug' + spec.add_development_dependency 'puma' spec.add_development_dependency 'rails-controller-testing' spec.add_development_dependency 'rake' spec.add_development_dependency 'rspec', '~> 3.0' @@ -41,8 +47,10 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'rspec-rails' spec.add_development_dependency 'rspec_junit_formatter' spec.add_development_dependency 'rubocop-rspec' + spec.add_development_dependency 'sass-rails' spec.add_development_dependency 'selenium-webdriver' spec.add_development_dependency 'sqlite3' + spec.add_development_dependency 'turbolinks' spec.add_development_dependency 'webdrivers' spec.add_development_dependency 'webmock' end diff --git a/spec/dummy_test_app/app/assets/config/manifest.js b/spec/dummy_test_app/app/assets/config/manifest.js index c8e290cd..1983ee4e 100644 --- a/spec/dummy_test_app/app/assets/config/manifest.js +++ b/spec/dummy_test_app/app/assets/config/manifest.js @@ -1,4 +1,3 @@ - //= link_tree ../images -//= link_directory ../javascripts .js -//= link_directory ../stylesheets .css +//= link application.css +//= link application.js diff --git a/spec/dummy_test_app/app/assets/javascripts/application.js b/spec/dummy_test_app/app/assets/javascripts/application.js index e54c6461..650abb23 100644 --- a/spec/dummy_test_app/app/assets/javascripts/application.js +++ b/spec/dummy_test_app/app/assets/javascripts/application.js @@ -10,4 +10,16 @@ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // + +// We want to test with turbolinks, which our code also requires rails-ujs to deal with: + +//= require rails-ujs +//= require turbolinks + +// Actual stack required for current browse-everything JS + +//= require jquery3 +//= require bootstrap +//= require browse_everything + //= require_tree . diff --git a/spec/dummy_test_app/app/assets/stylesheets/application.css b/spec/dummy_test_app/app/assets/stylesheets/application.scss similarity index 90% rename from spec/dummy_test_app/app/assets/stylesheets/application.css rename to spec/dummy_test_app/app/assets/stylesheets/application.scss index 0ebd7fe8..59543e08 100644 --- a/spec/dummy_test_app/app/assets/stylesheets/application.css +++ b/spec/dummy_test_app/app/assets/stylesheets/application.scss @@ -13,3 +13,6 @@ *= require_tree . *= require_self */ + +@import "bootstrap"; +@import "browse_everything/browse_everything_bootstrap4"; diff --git a/spec/dummy_test_app/app/controllers/file_handler_controller.rb b/spec/dummy_test_app/app/controllers/file_handler_controller.rb new file mode 100644 index 00000000..0000269e --- /dev/null +++ b/spec/dummy_test_app/app/controllers/file_handler_controller.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class FileHandlerController < ApplicationController + def index; end + + def main; end + + def update + render json: params[:selected_files].to_json + end +end diff --git a/spec/dummy_test_app/app/views/file_handler/index.html.erb b/spec/dummy_test_app/app/views/file_handler/index.html.erb new file mode 100644 index 00000000..7ae1c43a --- /dev/null +++ b/spec/dummy_test_app/app/views/file_handler/index.html.erb @@ -0,0 +1,10 @@ +
Please click the button below to start pickin' files!
+ + <%= form_tag('/file', id: 'main_form', method: 'post') do %> + <%= button_tag("Browse", type: 'button', class: 'btn btn-large btn-success', id: "browse-btn", + 'data-toggle' => 'browse-everything', 'data-route' => browse_everything_engine.root_path, + 'data-target' => '#main_form') %> + <%= button_tag("Submit", type: 'submit', class: 'btn btn-large btn-primary', id: "submit-btn") %> + <% end %> + +0 items selected
+ + +