Skip to content

Commit

Permalink
Merge branch 'master' into master-legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
thatandromeda committed Apr 1, 2020
2 parents 1ebe757 + 333089d commit 018bc48
Show file tree
Hide file tree
Showing 47 changed files with 764 additions and 696 deletions.
4 changes: 3 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
--colour
--drb
--profile
--color
--require rspec/pride
--format PrideFormatter
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). It uses [CalVer](https://calver.org/) as of May 2019.

## Unreleased
### Changed
* Sped up test suite (~25%)
* Upgrade simple_form (4.1 -> 5; thanks dependabot)

## [20.01b](https://github.com/berkmancenter/lumendatabase/releases/tag/2020.01b) - 2020-01-31
### Changed
* CMS URL promoted to the top level, so that the CMS is now serving blog and static page content
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ group :development do
gem 'bullet'
gem 'derailed'
gem 'memory_profiler'
gem 'web-console'
end

group :development, :test do
gem 'factory_bot_rails'
gem 'parallel_tests'
gem 'phantomjs'
gem 'pry', '~> 0.10.4'
gem 'pry-byebug'
Expand All @@ -85,12 +85,13 @@ group :test do
gem 'curb'
gem 'database_cleaner'
gem 'elasticsearch-extensions'
gem 'fakeweb'
gem 'poltergeist'
gem 'rack-test', require: 'rack/test'
gem 'rails-controller-testing'
gem 'rspec-pride'
gem 'shoulda-matchers', '~> 3.1', '>= 3.1.1'
gem 'simplecov', require: false
gem 'test-prof'
gem 'timecop'
gem 'vcr'
gem 'webmock'
Expand Down
116 changes: 60 additions & 56 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.4.1)
actionpack (= 5.2.4.1)
actioncable (5.2.4.2)
actionpack (= 5.2.4.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.4.1)
actionpack (= 5.2.4.1)
actionview (= 5.2.4.1)
activejob (= 5.2.4.1)
actionmailer (5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.4.1)
actionview (= 5.2.4.1)
activesupport (= 5.2.4.1)
actionpack (5.2.4.2)
actionview (= 5.2.4.2)
activesupport (= 5.2.4.2)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.1)
activesupport (= 5.2.4.1)
actionview (5.2.4.2)
activesupport (= 5.2.4.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
Expand All @@ -35,26 +35,26 @@ GEM
addressable
active_model_serializers (0.8.4)
activemodel (>= 3.0)
activejob (5.2.4.1)
activesupport (= 5.2.4.1)
activejob (5.2.4.2)
activesupport (= 5.2.4.2)
globalid (>= 0.3.6)
activemodel (5.2.4.1)
activesupport (= 5.2.4.1)
activemodel (5.2.4.2)
activesupport (= 5.2.4.2)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (5.2.4.1)
activemodel (= 5.2.4.1)
activesupport (= 5.2.4.1)
activerecord (5.2.4.2)
activemodel (= 5.2.4.2)
activesupport (= 5.2.4.2)
arel (>= 9.0)
activerecord-import (1.0.2)
activerecord (>= 3.2)
activestorage (5.2.4.1)
actionpack (= 5.2.4.1)
activerecord (= 5.2.4.1)
activestorage (5.2.4.2)
actionpack (= 5.2.4.2)
activerecord (= 5.2.4.2)
marcel (~> 0.3.1)
activesupport (5.2.4.1)
activesupport (5.2.4.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -69,7 +69,6 @@ GEM
arel (9.0.0)
bcrypt (3.1.13)
benchmark-ips (2.7.2)
bindex (0.8.1)
bootsnap (1.4.5)
msgpack (~> 1.0)
bootstrap-datepicker-rails (1.8.0.1)
Expand Down Expand Up @@ -114,7 +113,7 @@ GEM
sassc-rails (>= 2.0.0)
comfy_bootstrap_form (4.0.8)
rails (>= 5.0.0)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
country_select (1.2.0)
coveralls (0.7.1)
multi_json (~> 1.3)
Expand All @@ -124,7 +123,7 @@ GEM
thor
crack (0.4.3)
safe_yaml (~> 1.0.0)
crass (1.0.5)
crass (1.0.6)
curb (0.9.10)
database_cleaner (1.7.0)
date_validator (0.9.0)
Expand Down Expand Up @@ -178,7 +177,6 @@ GEM
factory_bot_rails (5.0.2)
factory_bot (~> 5.0.2)
railties (>= 4.2.0)
fakeweb (1.3.0)
faraday (0.15.4)
multipart-post (>= 1.2, < 3)
ffi (1.11.3)
Expand Down Expand Up @@ -208,7 +206,7 @@ GEM
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (1.7.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jquery-placeholder-rails (2.1.2)
jquery-rails (4.3.5)
Expand Down Expand Up @@ -249,11 +247,11 @@ GEM
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0904)
mimemagic (0.3.3)
mimemagic (0.3.4)
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
minitest (5.14.0)
msgpack (1.3.1)
multi_json (1.13.1)
multipart-post (2.1.1)
Expand All @@ -264,7 +262,7 @@ GEM
nested_form (0.3.2)
netrc (0.11.0)
nio4r (2.5.2)
nokogiri (1.10.7)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
oink (0.10.1)
activerecord
Expand All @@ -276,6 +274,9 @@ GEM
mime-types
mimemagic (~> 0.3.0)
terrapin (~> 0.6.0)
parallel (1.19.1)
parallel_tests (2.31.0)
parallel
pg (1.1.4)
phantomjs (2.1.1.0)
poltergeist (1.18.1)
Expand All @@ -291,8 +292,8 @@ GEM
pry (~> 0.10)
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (3.1.1)
rack (2.0.8)
public_suffix (4.0.3)
rack (2.0.9)
rack-accept (0.4.5)
rack (>= 0.4)
rack-attack (6.1.0)
Expand All @@ -304,18 +305,18 @@ GEM
rack (>= 1.1)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4.1)
actioncable (= 5.2.4.1)
actionmailer (= 5.2.4.1)
actionpack (= 5.2.4.1)
actionview (= 5.2.4.1)
activejob (= 5.2.4.1)
activemodel (= 5.2.4.1)
activerecord (= 5.2.4.1)
activestorage (= 5.2.4.1)
activesupport (= 5.2.4.1)
rails (5.2.4.2)
actioncable (= 5.2.4.2)
actionmailer (= 5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
activemodel (= 5.2.4.2)
activerecord (= 5.2.4.2)
activestorage (= 5.2.4.2)
activesupport (= 5.2.4.2)
bundler (>= 1.3.0)
railties (= 5.2.4.1)
railties (= 5.2.4.2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
Expand All @@ -341,9 +342,9 @@ GEM
rails (>= 5.0, < 7)
remotipart (~> 1.3)
sassc-rails (>= 1.3, < 3)
railties (5.2.4.1)
actionpack (= 5.2.4.1)
activesupport (= 5.2.4.1)
railties (5.2.4.2)
actionpack (= 5.2.4.2)
activesupport (= 5.2.4.2)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
Expand Down Expand Up @@ -371,6 +372,10 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rspec (3.6.0)
rspec-core (~> 3.6.0)
rspec-expectations (~> 3.6.0)
rspec-mocks (~> 3.6.0)
rspec-collection_matchers (1.1.3)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.6.0)
Expand All @@ -381,6 +386,8 @@ GEM
rspec-mocks (3.6.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.6.0)
rspec-pride (3.2.1)
rspec (~> 3.0)
rspec-rails (3.6.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
Expand Down Expand Up @@ -414,7 +421,7 @@ GEM
rack
shoulda-matchers (3.1.3)
activesupport (>= 4.0.0)
simple_form (4.1.0)
simple_form (5.0.0)
actionpack (>= 5.0)
activemodel (>= 5.0)
simplecov (0.17.0)
Expand All @@ -440,6 +447,7 @@ GEM
tins (~> 1.0)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
test-prof (0.10.2)
therubyracer (0.12.3)
libv8 (~> 3.16.14.15)
ref
Expand All @@ -464,15 +472,10 @@ GEM
vcr (4.0.0)
warden (1.2.7)
rack (>= 1.0)
web-console (3.7.0)
actionview (>= 5.0)
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webmock (3.4.2)
webmock (3.8.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
Expand Down Expand Up @@ -507,7 +510,6 @@ DEPENDENCIES
elasticsearch-model (~> 5.0)
elasticsearch-rails (~> 5.0)
factory_bot_rails
fakeweb
flutie
jquery-placeholder-rails
jquery-rails
Expand All @@ -521,6 +523,7 @@ DEPENDENCIES
neat
oink
paperclip (~> 5)
parallel_tests
pg (~> 1.1.4)
phantomjs
poltergeist
Expand All @@ -540,6 +543,7 @@ DEPENDENCIES
record_tag_helper (~> 1.0)
redcarpet
rspec-collection_matchers (~> 1.1, >= 1.1.2)
rspec-pride
rspec-rails
ruby-prof
sassc-rails
Expand All @@ -550,12 +554,12 @@ DEPENDENCIES
simplecov
skylight
stackprof
test-prof
therubyracer
timecop
turnout
uglifier
vcr
web-console
webmock

BUNDLED WITH
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,27 @@ may use chillingeffects.org rather than lumendatabase.org.

#### Running Tests

$ bundle exec rspec spec/
$ rspec

The integration tests are quite slow; for some development purposes you may
find it more convenient to `bundle exec rspec spec/ --exclude-pattern="spec/integration/*"`.

If `elasticsearch` isn't on your $PATH, set `ENV['TEST_CLUSTER_COMMAND']=/path/to/elasticsearch`, and make sure permissions are set correctly for your test suite to run it.

If you're running a subset of tests that you know don't require Elasticsearch,
you can run them without setting it up via
`TEST_WITH_ELASTICSEARCH=0 rspec path/to/tests`.

#### Parallelizing Tests
You can speed up tests by running them in parallel:
$ rake parallel:spec

You will need to do some setup before the first time you run this:
- alter `config/database.yml` so that the test database is `yourproject_test<%= ENV['TEST_ENV_NUMBER'] %>`
- run `rake parallel:setup`

It will default to using the number of processors parallel_tests believes to be available, but you can change this by setting `ENV['PARALLEL_TEST_PROCESSORS']` to the desired number.

#### Linting

Use rubocop and leave the code at least as clean as you found it. If you make
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/notices_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def json_root_for(klass)
end

def notice_params
params.require(:notice).except(:type).permit(
raw_params = params.require(:notice).except(:type).permit(
:title,
:subject,
:body,
Expand All @@ -108,6 +108,7 @@ def notice_params
],
works_attributes: work_params
)
raw_params.to_h
end

def entity_params
Expand Down
Loading

0 comments on commit 018bc48

Please sign in to comment.