Skip to content

Commit

Permalink
Removed Turbolinks 2 from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
justin808 committed Jun 3, 2017
1 parent ce4ae2a commit 4349533
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 35 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Changes since last non-beta release.
- Any failure in webpack to build test files quits tests.
- CI Improvements:
- Switched to yarn link and removed relative path install of react-on-rails
- Removed testing of Turbolinks 2
- All tests run against Rails 5.1.1
- [#862](https://github.com/shakacode/react_on_rails/pull/862) by [justin808](https://github.com/justin808)

## [8.0.1]
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ If you run `rspec` at the top level, you'll see this message: `require': cannot

After running a test, you can view the coverage results SimpleCov reports by opening `coverage/index.html`.

To test `spec/dummy` against Turbolinks 2, install the gem by running `ENABLE_TURBOLINKS_2=TRUE bundle install` in the `spec/dummy` directory before running `rake`. Turbolinks 5 is the default.
Turbolinks 5 is included in the test app, unless "DISABLE_TURBOLINKS" is set to YES in the environment.

Run `rake -T` or `rake -D` to see testing options.

Expand Down
8 changes: 1 addition & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ gem "scss_lint", require: false
gem "sdoc", group: :doc
gem "spring"
gem "sqlite3"
if ENV["ENABLE_TURBOLINKS_2"].nil? || ENV["ENABLE_TURBOLINKS_2"].strip.empty?
gem "turbolinks", "~> 5.0"
else
# rubocop:disable Bundler/DuplicatedGem
gem "turbolinks", "2.5.3"
# rubocop:enable Bundler/DuplicatedGem
end
gem "turbolinks", "~> 5.0"
gem "uglifier"
gem "web-console", group: :development

Expand Down
5 changes: 0 additions & 5 deletions rakelib/dummy_apps.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ namespace :dummy_apps do
bundle_install_in(dummy_app_dir)
end

task dummy_app_with_turbolinks_2: [:yarn_install] do
dummy_app_dir = File.join(gem_root, "spec/dummy")
bundle_install_with_turbolinks_2_in(dummy_app_dir)
end

task dummy_apps: %i[dummy_app node_package] do
puts "Prepared all Dummy Apps"
end
Expand Down
9 changes: 1 addition & 8 deletions rakelib/run_rspec.rake
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ namespace :run_rspec do
bundle_install_in(dummy_app_dir)
end

desc "Runs dummy respec with turbolinks 2"
task dummy_turbolinks_2: ["dummy_apps:dummy_app_with_turbolinks_2"] do
clean_gen_assets(spec_dummy_dir)
run_tests_in(spec_dummy_dir, env_vars:
"ENABLE_TURBOLINKS_2=TRUE BUNDLE_GEMFILE=#{dummy_app_dir}/Gemfile")
end

# Dynamically define Rake tasks for each example app found in the examples directory
ExampleType.all.each do |example_type|
desc "Runs RSpec for #{example_type.name_pretty} only"
Expand All @@ -61,7 +54,7 @@ namespace :run_rspec do
Coveralls::RakeTask.new if ENV["USE_COVERALLS"] == "TRUE"

desc "run all tests no examples"
task all_but_examples: %i[gem dummy_no_turbolinks dummy_turbolinks_2 dummy empty js_tests] do
task all_but_examples: %i[gem dummy_no_turbolinks dummy empty js_tests] do
puts "Completed all RSpec tests"
end

Expand Down
4 changes: 0 additions & 4 deletions rakelib/task_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ def bundle_install_in_no_turbolinks(dir)
sh_in_dir(dir, "DISABLE_TURBOLINKS=TRUE bundle install")
end

def bundle_install_with_turbolinks_2_in(dir)
sh_in_dir(dir, "ENABLE_TURBOLINKS_2=TRUE BUNDLE_GEMFILE=#{dir}/Gemfile bundle install")
end

# Runs bundle exec using that directory's Gemfile
def bundle_exec(dir: nil, args: nil, env_vars: "")
sh_in_dir(dir, "#{env_vars} #{args}")
Expand Down
8 changes: 1 addition & 7 deletions spec/dummy/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ gem "puma"

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
if ENV["DISABLE_TURBOLINKS"].nil? || ENV["DISABLE_TURBOLINKS"].strip.empty?
if ENV["ENABLE_TURBOLINKS_2"].nil? || ENV["ENABLE_TURBOLINKS_2"].strip.empty?
gem "turbolinks", "~> 5.0"
else
# rubocop:disable Bundler/DuplicatedGem
gem "turbolinks", "2.5.3"
# rubocop:enable Bundler/DuplicatedGem
end
gem "turbolinks", "~> 5.0"
end

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
Expand Down
7 changes: 4 additions & 3 deletions spec/dummy/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ GEM
thread_safe (0.3.6)
tilt (2.0.7)
tins (1.14.0)
turbolinks (2.5.3)
coffee-rails
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.3)
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.2.0)
Expand Down Expand Up @@ -328,7 +329,7 @@ DEPENDENCIES
selenium-webdriver
spring
sqlite3
turbolinks (= 2.5.3)
turbolinks (~> 5.0)
uglifier
webpacker_lite (= 2.0.4)

Expand Down

0 comments on commit 4349533

Please sign in to comment.