Commit graph

4041 commits

Author SHA1 Message Date
Andrew Kvalheim
63aa240e65 Fix migration that fails on conferences without pictures
CarrierWave documentation:

> Note: `recreate_versions!` will throw an exception on records without
> an image. To avoid this, scope the records to those with images or
> check if an image exists within the block.

Resolves #1976:

    NoMethodError: undefined method `read' for nil:NilClass
    …/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:81:in `sanitized_file'
    …/carrierwave-1.3.1/lib/carrierwave/uploader/cache.rb:118:in `cache!'
    …/carrierwave-1.3.1/lib/carrierwave/uploader/versions.rb:234:in `recreate_versions!'
    db/migrate/20171130172334_rebuild_conference_pictures.rb:4:in `block in up'
2020-05-12 07:43:58 -07:00
Andrew Kvalheim
4a0961e88e Annotate past migrations with Rails version
Many migrations currently fail to run with:

> Directly inheriting from ActiveRecord::Migration is not supported.
> Please specify the Rails release the migration was written for:
>
>     class Example < ActiveRecord::Migration[4.2]

I've annotated those that I need to run with the Rails version at the
time each was committed:

    rake db:migrate:status \
    | grep --perl-regexp --only-matching '(?<=^  down    )\d{14}' \
    | while read -r id; do
      path="$(ls -1 db/migrate/${id}_*.rb)"
      version="$(git show "$(git log --diff-filter=A --pretty=format:%H -- "$path")":Gemfile.lock \
        | grep --perl-regexp --only-matching '(?<=^    rails \()\d+\.\d+(?=(\.\d+)+\))')"
      sed --in-place -e "s/\(< ActiveRecord::Migration\)$/\\1[$version]/" "$path"
    done
2020-05-12 07:09:28 -07:00
Andrew Kvalheim
c34b55c1b8 Update Docker Compose file format: 2.0 → 2.4 (minor)
Allows the use of additional parameters such as `cpus` and
`healthcheck`.
2020-04-13 08:45:31 -07:00
Andrew Kvalheim
e657d37c8d Whitelist Webdrivers update URLs in WebMock
Resolves #2557:

    $ docker-compose run --rm osem bundle exec rspec --tag js
    …
    WebMock::NetConnectNotAllowedError

See titusfortner/webdrivers#109 for details.
2020-04-12 17:43:46 -07:00
Andrew Kvalheim
e077fe9671 Fix bug in test of animated form
The help text for the event type field is animated using a technique
unaffected by `Capybara.disable_animation`. Wait for the animation.

Resolves: #2356
Works around: #2661
2020-04-12 13:40:49 -07:00
James Mason
dfb159a0e1
Merge pull request #2638 from openSUSE/depfu/update/puma-3.12.4
🚨 [security] Update puma: 3.12.2 → 3.12.4 (patch)
2020-04-06 09:48:04 -07:00
James Mason
49639dadb1
Merge pull request #2637 from openSUSE/depfu/update/sqlite3-1.4.2
Update sqlite3: 1.4.1 → 1.4.2 (patch)
2020-04-06 09:46:41 -07:00
James Mason
8403074765
Merge pull request #2644 from openSUSE/depfu/update/json-2.3.0
🚨 [security] Update json: 2.2.0 → 2.3.0 (minor)
2020-04-06 09:46:08 -07:00
Stella Rouzi
303129bf45
Merge pull request #2652 from AndrewKvalheim/test-unspecified-order-2
Decouple tests from unspecified data ordering (part 2)
2020-04-06 15:26:07 +03:00
Andrew Kvalheim
ae00a7f055 Use Rails transactional tests
As of Rails 5.1:

  - Rails has built-in support for running tests within database
    transactions, so Database Cleaner is no longer needed for this.
  - Rails automatically shares the database connection across threads,
    so transactional_capybara is no longer needed.

Changes:

  - Enable `use_transactional_tests`.
  - Remove transactional_capybara.
  - Remove the Database Cleaner test wrapper.

This resolves:

  - transactional_capybara mismanages the shared database connection,
    causing the connection to falsely report as idle after the first
    test. At 6 minutes (idle_timeout + reaping_frequency) into testing,
    the connection is closed, causing e.g. `PG::ConnectionBad` errors.
2020-04-05 13:15:12 -07:00
Andrew Kvalheim
11a7e056bf Fix bug in test database preparation
Presumably the intent of this was to clear the database and repopulate
it with seed data. `transaction` isn't the right strategy for this; it
just rolls back any existing transactions.
2020-04-05 13:15:04 -07:00
Andrew Kvalheim
3aa32aebe8 Remove redundant code
This functionality is provided by transactional_capybara.
2020-04-05 13:14:55 -07:00
Andrew Kvalheim
75f64508de Work around RuboCop false positive
Details: rubocop-hq/rubocop#7853
2020-04-05 10:24:51 -07:00
Andrew Kvalheim
3142c0f164 Fix bug in logging of screenshots of failed tests
Presumably this was a typo.
2020-04-05 10:24:27 -07:00
Andrew Kvalheim
5b3520801f Use correct loading mode of Bootstrap-Markdown
data-provide="markdown-editable" is intended for inline editing of page
content à la contenteditable. When this is applied to a textarea, the
editor is loaded only after the user clicks on the field. This behavior
breaks focus and is incompatible with keyboard navigation.
2020-04-04 22:09:48 -07:00
Andrew Kvalheim
4182b6fb8f Fix bug in UserDatatable query affecting PostgreSQL
Resolves:

    $ docker-compose run --rm osem bundle exec rspec ./spec/datatables/user_datatable_spec.rb:97
    …
    ActiveRecord::StatementInvalid:
    PG::GroupingError: ERROR:  column "users.id" must appear in the GROUP BY clause or be used in an aggregate function
2020-04-04 10:35:56 -07:00
Andrew Kvalheim
d3e73b103f Document workaround for jbox-web/ajax-datatables-rails#293 2020-04-04 10:35:44 -07:00
Andrew Kvalheim
17c0abb2de Don't clobber RuboCop's default excludes
By default, adding an exclude (faffc49) has the effect of removing the
default excludes. Merge them as described in rubocop-hq/rubocop#6567.
2020-04-03 17:06:36 -07:00
Andrew Kvalheim
faffc49020 Exclude Rails database schema from linting
The schema is automatically generated, so RuboCop's recommendations are
non-actionable; ignore it as in rubocop-hq/rubocop#752.
2020-04-03 16:39:23 -07:00
Andrew Kvalheim
fe2e5febe3 Deconflate organization/conference IDs in role versions
Resolves failing test spec/features/versions_spec.rb:320.
2020-04-03 16:19:36 -07:00
Andrew Kvalheim
79cd1c9fcd Grant permission to read, revert organization_admin version
Without this permission, organization administrators can't see the
history of changes to the organization administrator role on the
Revision History screen.
2020-04-03 15:35:58 -07:00
Andrew Kvalheim
71d9860124 Test access to organization_admin version as organization_admin
This corrects the specification for the behavior of the Revision History
screen; changes to the organization administrator role should be
accessible to organization administrators, not conference organizers.
2020-04-03 15:35:44 -07:00
Andrew Kvalheim
aa61ec9692 Remove unused code 2020-04-03 15:35:25 -07:00
Andrew Kvalheim
a179a38fae Minor refactor 2020-04-01 08:53:46 -07:00
Andrew Kvalheim
10f0edac20 Decouple tests from unspecified data ordering
These tests have been passing with SQLite, but don't reflect guaranteed
behavior and with PostgreSQL failed intermittently.
2020-03-29 09:06:47 -07:00
Stella Rouzi
e709d080b4
Merge pull request #2650 from AndrewKvalheim/test-unspecified-order
Decouple tests from unspecified data ordering
2020-03-29 15:55:34 +03:00
Andrew Kvalheim
a7006a4edd Decouple tests from unspecified data ordering
These tests have been passing with SQLite, but don't reflect guaranteed
behavior and with PostgreSQL failed intermittently.
2020-03-28 15:15:01 -07:00
Andrew Kvalheim
f37eab88c7 Use Chrome::Options instead of Capabilities
Resolves:

    $ docker-compose run --rm osem bundle exec rspec --tag js
    …
    Selenium::WebDriver::Error::UnknownError:
    unknown error: Chrome failed to start: exited abnormally.
2020-03-28 13:30:45 -07:00
Andrew Kvalheim
d088a4ae17 Add missing Chromium dependencies in base image
Resolves:

    $ docker run --rm osem/base chromium --no-sandbox --headless
    … Check failed: InitDefaultFont(). Could not find the default font
2020-03-28 11:38:11 -07:00
Andrew Kvalheim
8eb696bb4a Use version range instead of OSEM_RUBY_VERSION 2020-03-28 08:59:16 -07:00
depfu[bot]
0e3e832770
Update json to version 2.3.0 2020-03-19 15:49:52 +00:00
Andrew Kvalheim
38b6486550 Use database password in Docker Compose environment
Addresses docker-library/postgres#681.
2020-03-14 16:33:31 -07:00
depfu[bot]
5c57ccdf5a
Update puma to version 3.12.4 2020-03-03 11:18:54 +00:00
Michael Ball
408f341226 Allow in robots 2020-02-27 02:51:09 -08:00
Michael Ball
55ce5cb5f6 Add messages@snap as a bcc for all snapcon emails 2020-02-20 22:04:09 -08:00
Michael Ball
2ede9f310c Fix sentry-raven gem in the gemfile 2020-02-19 13:36:18 -08:00
Michael Ball
5932e27b85 Add sentry config 2020-02-19 13:16:48 -08:00
depfu[bot]
8598652433
Update sqlite3 to version 1.4.2 2020-02-19 13:11:48 +00:00
Henne Vogelsang
e6f3aa559e
Merge pull request #2636 from openSUSE/depfu/update/nokogiri-1.10.8
🚨 [security] Update nokogiri: 1.10.5 → 1.10.8 (patch)
2020-02-19 14:07:45 +01:00
depfu[bot]
153b825923
Update nokogiri to version 1.10.8 2020-02-11 11:47:10 +00:00
Michael Ball
d3e58f405a
Merge pull request #30 from snap-cloud/admin-ticketing
Admin ticketing
2020-02-06 02:10:30 -08:00
Michael Ball
be991c53d3 Merge branch 'master' of github.com:snap-cloud/snapcon into admin-ticketing
* 'master' of github.com:snap-cloud/snapcon: (22 commits)
  Cleanup some Auth specs and weird haml syntax
  add sentry puma hooks
  fix user model spec
  Tweak Tickets Text
  fix missing ]
  Fix specs for omniauth providers?
  Update stripe mock gem
  remove airbrake
  Add sentry logging
  Update stripe gem
  Cleanup stripe stuff
  Fix the docker init script
  Cleanup specs
  Cleanup config file, ensure providers are set if present
  Fix format spec with new markdown options
  Try to update spec file with image in navbar
  Delint
  Delint helpers
  Lint: Sort gems
  Update user model spec
  ...
2020-02-06 02:02:20 -08:00
Michael Ball
231b2a6d72 Update tickets controller spec for Rails 5 2020-02-06 01:46:21 -08:00
Michael Ball
d06c3ce035 Run db:migrate 2020-02-06 01:41:09 -08:00
Michael Ball
4306fbe636 Merge branch 'master' into admin-ticketing
* master: (61 commits)
  Replace more Commercials with Materials
  Rename more commericals to materials
  UI -- Repalce "Commerials" with "Materials".
  Re-order Conference Associations
  Cleanup CSS add Snap! style block attachments
  hide venue link if there is no venue link
  No dropshadow
  Text with drop shadow for now
  Tidy up the look of lodging panels
  Show reg status for tickets.
  Tweak CSS, fix loding order
  Move the venue description to below the map.
  Update lodging styling. Add description for venu when map is shown.
  CSS tweaks...
  Make the edit form not so wide.
  Support markdown in more fields
  Cleanup CSS ordering, fix coloring for navdropdowns
  dumb...fix order of link_to args
  ARRRGHHH, another typo...same line...
  fix typo
  ...
2020-02-06 01:37:38 -08:00
Michael Ball
7586112f72 Merge master 2020-02-06 01:20:11 -08:00
Michael Ball
1b4132fb19
Merge pull request #28 from snap-cloud/fix-build
Attempt to Unbreak Stuff
2020-02-06 01:12:02 -08:00
Michael Ball
a72633e2d9 Cleanup some Auth specs and weird haml syntax 2020-02-06 00:47:40 -08:00
Michael Ball
cc9a759960 add sentry puma hooks 2020-02-05 23:25:08 -08:00
Michael Ball
142e93bebc fix user model spec 2020-02-05 23:25:00 -08:00