Skip to content

Commit

Permalink
Merge pull request #323 from openstax/fix_fine_print
Browse files Browse the repository at this point in the history
Fine Print and other minor fixes
  • Loading branch information
Dantemss authored Apr 26, 2021
2 parents 107b23e + b7b199e commit 09f8d1a
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 104 deletions.
131 changes: 64 additions & 67 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@ GEM
action_interceptor (1.2.0)
addressable
rails (>= 3.1)
actioncable (6.1.1)
actionpack (= 6.1.1)
activesupport (= 6.1.1)
actioncable (6.1.3.1)
actionpack (= 6.1.3.1)
activesupport (= 6.1.3.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.1)
actionpack (= 6.1.1)
activejob (= 6.1.1)
activerecord (= 6.1.1)
activestorage (= 6.1.1)
activesupport (= 6.1.1)
actionmailbox (6.1.3.1)
actionpack (= 6.1.3.1)
activejob (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
mail (>= 2.7.1)
actionmailer (6.1.1)
actionpack (= 6.1.1)
actionview (= 6.1.1)
activejob (= 6.1.1)
activesupport (= 6.1.1)
actionmailer (6.1.3.1)
actionpack (= 6.1.3.1)
actionview (= 6.1.3.1)
activejob (= 6.1.3.1)
activesupport (= 6.1.3.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.1)
actionview (= 6.1.1)
activesupport (= 6.1.1)
actionpack (6.1.3.1)
actionview (= 6.1.3.1)
activesupport (= 6.1.3.1)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.1)
actionpack (= 6.1.1)
activerecord (= 6.1.1)
activestorage (= 6.1.1)
activesupport (= 6.1.1)
actiontext (6.1.3.1)
actionpack (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
nokogiri (>= 1.8.5)
actionview (6.1.1)
activesupport (= 6.1.1)
actionview (6.1.3.1)
activesupport (= 6.1.3.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -54,24 +54,24 @@ GEM
actionpack (>= 3.0.2, < 6.2)
activemodel (>= 3.0.2, < 6.2)
activesupport (>= 3.0.2, < 6.2)
activejob (6.1.1)
activesupport (= 6.1.1)
activejob (6.1.3.1)
activesupport (= 6.1.3.1)
globalid (>= 0.3.6)
activemodel (6.1.1)
activesupport (= 6.1.1)
activerecord (6.1.1)
activemodel (= 6.1.1)
activesupport (= 6.1.1)
activemodel (6.1.3.1)
activesupport (= 6.1.3.1)
activerecord (6.1.3.1)
activemodel (= 6.1.3.1)
activesupport (= 6.1.3.1)
activerecord-import (1.0.7)
activerecord (>= 3.2)
activestorage (6.1.1)
actionpack (= 6.1.1)
activejob (= 6.1.1)
activerecord (= 6.1.1)
activesupport (= 6.1.1)
marcel (~> 0.3.1)
mimemagic (~> 0.3.2)
activesupport (6.1.1)
activestorage (6.1.3.1)
actionpack (= 6.1.3.1)
activejob (= 6.1.3.1)
activerecord (= 6.1.3.1)
activesupport (= 6.1.3.1)
marcel (~> 1.0.0)
mini_mime (~> 1.0.2)
activesupport (6.1.3.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand Down Expand Up @@ -201,7 +201,7 @@ GEM
httparty (0.18.1)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.8.8)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5)
Expand Down Expand Up @@ -236,36 +236,33 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.9.0)
loofah (2.9.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
marcel (1.0.1)
maruku (0.7.3)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.1104)
mimemagic (0.3.8)
nokogiri (~> 1)
mini_magick (4.11.0)
mini_mime (1.0.2)
mini_mime (1.0.3)
mini_portile2 (2.5.0)
mini_racer (0.3.1)
libv8 (~> 8.4.255)
minitest (5.14.3)
minitest (5.14.4)
msgpack (1.4.2)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
nifty-generators (0.4.6)
nio4r (2.5.4)
nokogiri (1.11.1)
nio4r (2.5.7)
nokogiri (1.11.3)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
nokogiri (1.11.1-x86_64-linux)
nokogiri (1.11.3-x86_64-linux)
racc (~> 1.4)
nokogumbo (2.0.4)
nokogiri (~> 1.8, >= 1.8.4)
Expand Down Expand Up @@ -337,20 +334,20 @@ GEM
rack-test (1.1.0)
rack (>= 1.0, < 3)
railroady (1.5.3)
rails (6.1.1)
actioncable (= 6.1.1)
actionmailbox (= 6.1.1)
actionmailer (= 6.1.1)
actionpack (= 6.1.1)
actiontext (= 6.1.1)
actionview (= 6.1.1)
activejob (= 6.1.1)
activemodel (= 6.1.1)
activerecord (= 6.1.1)
activestorage (= 6.1.1)
activesupport (= 6.1.1)
rails (6.1.3.1)
actioncable (= 6.1.3.1)
actionmailbox (= 6.1.3.1)
actionmailer (= 6.1.3.1)
actionpack (= 6.1.3.1)
actiontext (= 6.1.3.1)
actionview (= 6.1.3.1)
activejob (= 6.1.3.1)
activemodel (= 6.1.3.1)
activerecord (= 6.1.3.1)
activestorage (= 6.1.3.1)
activesupport (= 6.1.3.1)
bundler (>= 1.15.0)
railties (= 6.1.1)
railties (= 6.1.3.1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
Expand All @@ -362,9 +359,9 @@ GEM
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.1.1)
actionpack (= 6.1.1)
activesupport (= 6.1.1)
railties (6.1.3.1)
actionpack (= 6.1.3.1)
activesupport (= 6.1.3.1)
method_source
rake (>= 0.8.7)
thor (~> 1.0)
Expand Down Expand Up @@ -586,4 +583,4 @@ DEPENDENCIES
web-console

BUNDLED WITH
2.2.6
2.2.15
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

ENV['RAILS_ENV'] = 'test' if ARGV[0] == 'parallel:spec'

require File.expand_path('../config/application', __FILE__)

Exercises::Application.load_tasks
3 changes: 2 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
module Exercises
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
# TODO: Figure out what breaks VocabDistractor when flipping this to 6.1.
# TODO: load_defaults 6.1 turns on config.active_record.has_many_inversing
# which breaks VocabDistractor tests
config.load_defaults 6.0

# Configuration for the application, engines, and railties goes here.
Expand Down
4 changes: 0 additions & 4 deletions config/initializers/controllers.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ActionController::Base.class_exec do

protect_from_forgery

layout "layouts/application_body_only"
Expand All @@ -18,7 +17,4 @@ def current_administrator
def authenticate_administrator!
current_administrator || raise(SecurityTransgression)
end

end

FinePrint::ApplicationController.send :layout, "application_body_only"
4 changes: 1 addition & 3 deletions config/initializers/fine_print.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FinePrint.configure do |config|

# Engine Configuration: Must be set in an initializer

# Layout to be used for FinePrint's controllers
# Default: 'application'
config.layout = 'application'
config.layout = 'application_body_only'

# Array of custom helpers for FinePrint's controllers
# Default: [] (no custom helpers)
Expand Down Expand Up @@ -57,5 +56,4 @@
config.redirect_to_contracts_proc = ->(user, contracts) do
redirect_to(fine_print.new_contract_signature_path(contract_id: contracts.first.id))
end

end
27 changes: 0 additions & 27 deletions config/initializers/join_dependency_backport.rb

This file was deleted.

27 changes: 25 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,32 @@
require 'codecov'
require 'parallel_tests'

SimpleCov.formatter = SimpleCov::Formatter::Codecov if ENV['CI'] == 'true'
# Deactivate automatic result merging, because we use custom result merging code
SimpleCov.use_merging false

SimpleCov.start 'rails'
# Custom result merging code to avoid the many partial merges that SimpleCov usually creates
# and send to codecov only once
SimpleCov.at_exit do
# Store the result for later merging
SimpleCov::ResultMerger.store_result(SimpleCov.result)

# All processes except one will exit here
next unless ParallelTests.last_process?

# Wait for everyone else to finish
ParallelTests.wait_for_other_processes_to_finish

# Send merged result to codecov only if on CI (will generate HTML report by default locally)
SimpleCov.formatter = SimpleCov::Formatter::Codecov if ENV['CI'] == 'true'

# Merge coverage reports (and maybe send to codecov)
SimpleCov::ResultMerger.merged_result.format!
end

# Start calculating code coverage
unless ENV['NO_COVERAGE']
SimpleCov.start('rails') { merge_timeout 3600 }
end

ENV['RAILS_ENV'] = 'test'

Expand Down

0 comments on commit 09f8d1a

Please sign in to comment.