diff --git a/Gemfile b/Gemfile index 5c21c9d3..fa46b133 100644 --- a/Gemfile +++ b/Gemfile @@ -2,35 +2,35 @@ source "https://rubygems.org" gem "rails", "6.0.3.2" -gem "bootsnap", "~> 1.4" -gem "generic_form_builder", "~> 0.13.1" -gem "mysql2", "~> 0.4.5" -gem "sass-rails", "~> 5.1.0" -gem "sidekiq-scheduler", "~> 3.0" -gem "uglifier", "~> 4.2.0" +gem "bootsnap" +gem "generic_form_builder" +gem "mysql2" +gem "sass-rails" +gem "sidekiq-scheduler" +gem "uglifier" # GDS managed gems -gem "gds-api-adapters", "~> 67.0.1" -gem "gds-sso", "~> 15.0.1" +gem "gds-api-adapters" +gem "gds-sso" gem "govuk_admin_template" -gem "govuk_app_config", "~> 2.2.1" -gem "govuk_publishing_components", "~> 21.60.1" -gem "govuk_sidekiq", "~> 4.0" +gem "govuk_app_config" +gem "govuk_publishing_components" +gem "govuk_sidekiq" gem "mail-notify" -gem "plek", "~> 4.0.0" +gem "plek" group :test do gem "cucumber-rails", require: false - gem "database_cleaner", "~> 1.8.5" - gem "factory_bot_rails", "~> 6" - gem "govuk-content-schema-test-helpers", "~> 1.6.1" - gem "webmock", "~> 3.8.3" + gem "database_cleaner" + gem "factory_bot_rails" + gem "govuk-content-schema-test-helpers" + gem "webmock" end group :test, :development do - gem "listen", "~> 3.2" + gem "listen" gem "pry-byebug" gem "rails-controller-testing" # support `expect(..).to render_template(..)` for rails >= 5.0 - gem "rspec-rails", "~> 4.0.1" + gem "rspec-rails" gem "rubocop-govuk" end diff --git a/Gemfile.lock b/Gemfile.lock index bfb6101a..7d1bcc3a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -59,15 +59,15 @@ GEM addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) ast (2.4.1) - autoprefixer-rails (9.7.4) + autoprefixer-rails (9.8.6.1) execjs - bootsnap (1.4.6) + bootsnap (1.4.7) msgpack (~> 1.0) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.2.4) - byebug (11.1.1) + byebug (11.1.3) capybara (3.33.0) addressable mini_mime (>= 0.1.3) @@ -76,33 +76,37 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - coderay (1.1.2) + coderay (1.1.3) concurrent-ruby (1.1.6) connection_pool (2.2.3) crack (0.4.3) safe_yaml (~> 1.0.0) crass (1.0.6) - cucumber (4.0.1) + cucumber (4.1.0) builder (~> 3.2, >= 3.2.3) - cucumber-core (~> 7.0, >= 7.0.0) + cucumber-core (~> 7.1, >= 7.1.0) + cucumber-create-meta (~> 1.0.0, >= 1.0.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) - cucumber-gherkin (~> 13.0, >= 13.0.0) - cucumber-html-formatter (~> 6.0, >= 6.0.1) - cucumber-messages (~> 12.1, >= 12.1.1) - cucumber-wire (~> 3.0, >= 3.0.0) + cucumber-gherkin (~> 14.0, >= 14.0.1) + cucumber-html-formatter (~> 7.0, >= 7.0.0) + cucumber-messages (~> 12.2, >= 12.2.0) + cucumber-wire (~> 3.1, >= 3.1.0) diff-lcs (~> 1.3, >= 1.3, < 1.4) multi_test (~> 0.1, >= 0.1.2) sys-uname (~> 1.0, >= 1.0.2) - cucumber-core (7.0.0) - cucumber-gherkin (~> 13.0, >= 13.0.0) - cucumber-messages (~> 12.1, >= 12.1.1) + cucumber-core (7.1.0) + cucumber-gherkin (~> 14.0, >= 14.0.1) + cucumber-messages (~> 12.2, >= 12.2.0) cucumber-tag-expressions (~> 2.0, >= 2.0.4) - cucumber-cucumber-expressions (10.2.1) - cucumber-gherkin (13.0.0) - cucumber-messages (~> 12.0, >= 12.0.0) - cucumber-html-formatter (6.0.3) - cucumber-messages (~> 12.1, >= 12.1.1) - cucumber-messages (12.1.1) + cucumber-create-meta (1.0.0) + cucumber-messages (~> 12.2, >= 12.2.0) + sys-uname (~> 1.2, >= 1.2.1) + cucumber-cucumber-expressions (10.2.2) + cucumber-gherkin (14.2.0) + cucumber-messages (~> 12.4, >= 12.4.0) + cucumber-html-formatter (7.2.0) + cucumber-messages (~> 12.4, >= 12.4.0) + cucumber-messages (12.4.0) protobuf-cucumber (~> 3.10, >= 3.10.8) cucumber-rails (2.1.0) capybara (>= 2.12, < 4) @@ -111,10 +115,10 @@ GEM nokogiri (~> 1.8) rails (>= 4.2, < 7) cucumber-tag-expressions (2.0.4) - cucumber-wire (3.0.0) - cucumber-core (~> 7.0, >= 7.0.0) + cucumber-wire (3.1.0) + cucumber-core (~> 7.1, >= 7.1.0) cucumber-cucumber-expressions (~> 10.1, >= 10.1.0) - cucumber-messages (~> 12.1, >= 12.1.1) + cucumber-messages (~> 12.2, >= 12.2.0) database_cleaner (1.8.5) diff-lcs (1.3) domain_name (0.5.20190701) @@ -131,10 +135,10 @@ GEM railties (>= 5.0.0) faraday (1.0.1) multipart-post (>= 1.2, < 3) - ffi (1.12.2) - fugit (1.3.3) + ffi (1.13.1) + fugit (1.3.6) et-orbi (~> 1.1, >= 1.1.8) - raabro (~> 1.1) + raabro (~> 1.3) gds-api-adapters (67.0.1) addressable link_header @@ -228,12 +232,12 @@ GEM multi_test (0.1.2) multi_xml (0.6.0) multipart-post (2.1.1) - mysql2 (0.4.10) + mysql2 (0.5.3) netrc (0.11.0) nio4r (2.5.2) nokogiri (1.10.10) mini_portile2 (~> 2.4.0) - notifications-ruby-client (5.1.2) + notifications-ruby-client (5.2.0) jwt (>= 1.5, < 3) null_logger (0.0.1) oauth2 (1.4.4) @@ -251,23 +255,23 @@ GEM omniauth-oauth2 (1.3.1) oauth2 (~> 1.0) omniauth (~> 1.2) - parallel (1.19.1) - parser (2.7.1.3) - ast (~> 2.4.0) + parallel (1.19.2) + parser (2.7.1.4) + ast (~> 2.4.1) plek (4.0.0) protobuf-cucumber (3.10.8) activesupport (>= 3.2) middleware thor thread_safe - pry (0.13.0) + pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.9.0) byebug (~> 11.0) pry (~> 0.13.0) public_suffix (4.0.5) - raabro (1.1.6) + raabro (1.3.1) rack (2.2.3) rack-protection (2.0.8.1) rack @@ -339,47 +343,44 @@ GEM rspec-mocks (~> 3.9) rspec-support (~> 3.9) rspec-support (3.9.3) - rubocop (0.85.1) + rubocop (0.87.1) parallel (~> 1.10) - parser (>= 2.7.0.1) + parser (>= 2.7.1.1) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.7) rexml - rubocop-ast (>= 0.0.3) + rubocop-ast (>= 0.1.0, < 1.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (0.0.3) - parser (>= 2.7.0.1) - rubocop-govuk (3.16.0) - rubocop (= 0.85.1) + rubocop-ast (0.3.0) + parser (>= 2.7.1.4) + rubocop-govuk (3.17.0) + rubocop (= 0.87.1) rubocop-rails (= 2.6.0) rubocop-rake (= 0.5.1) - rubocop-rspec (= 1.39.0) + rubocop-rspec (= 1.42.0) rubocop-rails (2.6.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 0.82.0) rubocop-rake (0.5.1) rubocop - rubocop-rspec (1.39.0) - rubocop (>= 0.68.1) + rubocop-rspec (1.42.0) + rubocop (>= 0.87.0) ruby-progressbar (1.10.1) rufus-scheduler (3.6.0) fugit (~> 1.1, >= 1.1.6) safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.1.0) - railties (>= 5.2.0) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) - sassc (2.3.0) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) + sassc (2.4.0) ffi (~> 1.9) + sassc-rails (2.1.2) + railties (>= 4.0.0) + sassc (>= 2.0) + sprockets (> 3.0) + sprockets-rails + tilt sentry-raven (3.0.0) faraday (>= 1.0) sidekiq (5.2.9) @@ -411,7 +412,8 @@ GEM ffi (>= 1.0.0) thor (1.0.1) thread_safe (0.3.6) - thwait (0.1.0) + thwait (0.2.0) + e2mmap tilt (2.0.10) tzinfo (1.2.7) thread_safe (~> 0.1) @@ -443,31 +445,31 @@ PLATFORMS ruby DEPENDENCIES - bootsnap (~> 1.4) + bootsnap cucumber-rails - database_cleaner (~> 1.8.5) - factory_bot_rails (~> 6) - gds-api-adapters (~> 67.0.1) - gds-sso (~> 15.0.1) - generic_form_builder (~> 0.13.1) - govuk-content-schema-test-helpers (~> 1.6.1) + database_cleaner + factory_bot_rails + gds-api-adapters + gds-sso + generic_form_builder + govuk-content-schema-test-helpers govuk_admin_template - govuk_app_config (~> 2.2.1) - govuk_publishing_components (~> 21.60.1) - govuk_sidekiq (~> 4.0) - listen (~> 3.2) + govuk_app_config + govuk_publishing_components + govuk_sidekiq + listen mail-notify - mysql2 (~> 0.4.5) - plek (~> 4.0.0) + mysql2 + plek pry-byebug rails (= 6.0.3.2) rails-controller-testing - rspec-rails (~> 4.0.1) + rspec-rails rubocop-govuk - sass-rails (~> 5.1.0) - sidekiq-scheduler (~> 3.0) - uglifier (~> 4.2.0) - webmock (~> 3.8.3) + sass-rails + sidekiq-scheduler + uglifier + webmock BUNDLED WITH 1.17.3 diff --git a/app/models/bet.rb b/app/models/bet.rb index a1cd26f4..a618cf46 100644 --- a/app/models/bet.rb +++ b/app/models/bet.rb @@ -37,7 +37,11 @@ def set_defaults if expiration_date.nil? self.expiration_date = default_expiration_date self.permanent = false - save + if save + true + else + false + end end end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a0451619..721352dd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,6 +1,6 @@ <% content_for :head do %> <%= stylesheet_link_tag "application", :media => "all" %> - <%= csrf_meta_tags %> + <%= csp_meta_tag %> <% end %> <%= render "govuk_publishing_components/components/layout_for_admin", { @@ -16,7 +16,7 @@ } %>