diff --git a/Gemfile b/Gemfile index 0487e1867..4a5918ca4 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "rails", "5.2.7.1" +gem "rails", "5.2.8" # Legacy Rails features, remove me! # responders (class level) @@ -10,7 +10,7 @@ gem "responders", "3.0.1" # Appserver -gem "unicorn", "6.0.0", require: false +gem "unicorn", "6.1.0", require: false gem "unicorn-worker-killer", "0.4.5" # Federation @@ -21,16 +21,16 @@ gem "diaspora_federation-rails", "0.2.7" # API and JSON gem "acts_as_api", "1.0.1" -gem "json", "2.3.0" -gem "json-schema", "2.8.1" +gem "json", "2.6.2" +gem "json-schema", "3.0.0" gem "yajl-ruby", "1.4.1" # Authentication -gem "devise", "4.8.0" +gem "devise", "4.8.1" gem "devise_lastseenable", "0.0.6" -gem "devise-two-factor", "4.0.1" -gem "rqrcode", "2.1.0" +gem "devise-two-factor", "4.0.2" +gem "rqrcode", "2.1.1" # Captcha @@ -38,21 +38,21 @@ gem "simple_captcha2", "0.5.0", require: "simple_captcha" # Background processing -gem "redis", "4.5.1" -gem "sidekiq", "6.2.2" +gem "redis", "4.7.0" +gem "sidekiq", "6.4.2" # Scheduled processing -gem "sidekiq-cron", "1.2.0" +gem "sidekiq-cron", "1.4.0" # Compression -gem "terser", "1.1.7" +gem "terser", "1.1.10" # Configuration gem "configurate", "0.5.0" -gem "toml-rb", "2.1.0" +gem "toml-rb", "2.1.2" # Cross-origin resource sharing @@ -60,28 +60,28 @@ gem "rack-cors", "1.1.1", require: "rack/cors" # CSS -gem "autoprefixer-rails", "10.3.3.0" +gem "autoprefixer-rails", "10.4.7.0" gem "bootstrap-sass", "3.4.1" gem "bootstrap-switch-rails", "3.3.3" # 3.3.4 and 3.3.5 is broken, see https://github.com/Bttstrp/bootstrap-switch/issues/691 gem "compass-rails", "3.1.0" gem "sass-rails", "5.0.7" -gem "sprockets-rails", "3.2.2" +gem "sprockets-rails", "3.4.2" # Database group :mysql, optional: true do - gem "mysql2", "0.5.3" + gem "mysql2", "0.5.4" end group :postgresql, optional: true do - gem "pg", "1.2.3" + gem "pg", "1.4.1" end -gem "activerecord-import", "1.1.0" +gem "activerecord-import", "1.4.0" # File uploading gem "carrierwave", "2.2.2" -gem "fog-aws", "3.12.0" +gem "fog-aws", "3.14.0" gem "mini_magick", "4.11.0" # GUID generation @@ -94,14 +94,14 @@ gem "entypo-rails", "3.0.0" # JavaScript gem "handlebars_assets", "0.23.9" -gem "jquery-rails", "4.4.0" +gem "jquery-rails", "4.5.0" gem "jquery-ui-rails", "5.0.5" -gem "js-routes", "2.1.2" +gem "js-routes", "2.2.4" gem "js_image_paths", "0.1.1" gem "sprockets-es6", "0.9.2" source "https://gems.diasporafoundation.org" do - gem "rails-assets-jquery", "3.5.1" # Should be kept in sync with jquery-rails + gem "rails-assets-jquery", "3.6.0" # Should be kept in sync with jquery-rails gem "rails-assets-highlightjs", "9.12.0" gem "rails-assets-markdown-it", "8.4.2" @@ -114,6 +114,7 @@ source "https://gems.diasporafoundation.org" do gem "rails-assets-markdown-it-sup", "1.0.0" gem "rails-assets-backbone", "1.3.3" + gem "rails-assets-bootstrap", "3.4.1" gem "rails-assets-bootstrap-markdown", "2.10.0" gem "rails-assets-corejs-typeahead", "1.2.1" gem "rails-assets-cropperjs", "1.4.3" @@ -150,7 +151,7 @@ gem "leaflet-rails", "1.7.0" gem "nokogiri", "1.12.5" gem "open_graph_reader", "0.7.2" # also update User-Agent in features/support/webmock.rb and open_graph_cache_spec.rb gem "redcarpet", "3.5.1" -gem "ruby-oembed", "0.15.0" +gem "ruby-oembed", "0.16.1" gem "twitter-text", "3.1.0" # RTL support @@ -163,8 +164,8 @@ gem "secure_headers", "6.3.3" # Services -gem "omniauth", "2.0.4" -gem "omniauth-rails_csrf_protection", "1.0.0" +gem "omniauth", "2.1.0" +gem "omniauth-rails_csrf_protection", "1.0.1" gem "omniauth-tumblr", "1.2" gem "omniauth-twitter", "1.4.0" gem "omniauth-wordpress", "0.2.2" @@ -175,7 +176,7 @@ gem "openid_connect", "1.3.0" # Serializers -gem "active_model_serializers", "0.9.7" +gem "active_model_serializers", "0.9.8" # Tags @@ -184,7 +185,7 @@ gem "acts-as-taggable-on", "8.1.0" # URIs and HTTP gem "addressable", "2.8.0", require: "addressable/uri" -gem "faraday", "0.17.4" +gem "faraday", "0.17.5" gem "faraday-cookie_jar", "0.0.7" gem "faraday_middleware", "0.14.0" gem "typhoeus", "1.4.0" @@ -192,9 +193,9 @@ gem "typhoeus", "1.4.0" # Views gem "gon", "6.4.0" -gem "hamlit", "2.15.1" +gem "hamlit", "2.16.0" gem "mobile-fu", "1.4.0" -gem "rails-timeago", "2.19.1" +gem "rails-timeago", "2.20.0" gem "will_paginate", "3.3.1" # Logging @@ -210,7 +211,7 @@ gem "rubyzip", "2.3.2", require: "zip" # https://github.com/gitlabhq/gitlabhq/issues/3826 # https://github.com/gitlabhq/gitlabhq/pull/3852 # https://github.com/discourse/discourse/pull/238 -gem "minitest" +gem "minitest", "5.15.0" gem "versionist", "2.0.1" @@ -238,15 +239,15 @@ group :production do # we don"t install these on travis to speed up test runs # Third party asset hosting - gem "asset_sync", "2.15.0", require: false + gem "asset_sync", "2.15.2", require: false end group :development do # Linters - gem "haml_lint", "0.37.1", require: false + gem "haml_lint", "0.40.0", require: false gem "pronto", "0.11.0", require: false gem "pronto-eslint", "0.11.0", require: false - gem "pronto-haml", "0.11.0", require: false + gem "pronto-haml", "0.11.1", require: false gem "pronto-rubocop", "0.11.1", require: false gem "pronto-scss", "0.11.0", require: false gem "rubocop", "0.93.1", require: false @@ -261,7 +262,7 @@ group :development do gem "turbo_dev_assets", "0.0.2" - gem "listen", "3.5.1" + gem "listen", "3.7.1" end group :test do @@ -269,7 +270,6 @@ group :test do gem "fixture_builder", "0.5.2" gem "fuubar", "2.5.1" - gem "json-schema-rspec", "0.0.4" gem "rspec-json_expectations", "~> 2.1" # Cucumber (integration tests) @@ -284,7 +284,7 @@ group :test do gem "factory_bot_rails", "6.1.0" gem "shoulda-matchers", "4.5.1" - gem "timecop", "0.9.4" + gem "timecop", "0.9.5" gem "webmock", "3.14.0", require: false gem "diaspora_federation-test", "0.2.7" @@ -292,10 +292,10 @@ end group :development, :test do # RSpec (unit tests, some integration tests) - gem "rspec-rails", "5.0.2" + gem "rspec-rails", "5.1.2" # Cucumber (integration tests) - gem "cucumber-rails", "2.4.0", require: false + gem "cucumber-rails", "2.5.1", require: false # Jasmine (client side application tests (JS)) gem "chrome_remote", "0.3.0" diff --git a/Gemfile.lock b/Gemfile.lock index bf44c3908..64d0a6154 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,48 +2,48 @@ GEM remote: https://rubygems.org/ remote: https://gems.diasporafoundation.org/ specs: - actioncable (5.2.7.1) - actionpack (= 5.2.7.1) + actioncable (5.2.8) + actionpack (= 5.2.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.7.1) - actionpack (= 5.2.7.1) - actionview (= 5.2.7.1) - activejob (= 5.2.7.1) + actionmailer (5.2.8) + actionpack (= 5.2.8) + actionview (= 5.2.8) + activejob (= 5.2.8) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.7.1) - actionview (= 5.2.7.1) - activesupport (= 5.2.7.1) + actionpack (5.2.8) + actionview (= 5.2.8) + activesupport (= 5.2.8) 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.7.1) - activesupport (= 5.2.7.1) + actionview (5.2.8) + activesupport (= 5.2.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - active_model_serializers (0.9.7) + active_model_serializers (0.9.8) activemodel (>= 3.2) concurrent-ruby (~> 1.0) - activejob (5.2.7.1) - activesupport (= 5.2.7.1) + activejob (5.2.8) + activesupport (= 5.2.8) globalid (>= 0.3.6) - activemodel (5.2.7.1) - activesupport (= 5.2.7.1) - activerecord (5.2.7.1) - activemodel (= 5.2.7.1) - activesupport (= 5.2.7.1) + activemodel (5.2.8) + activesupport (= 5.2.8) + activerecord (5.2.8) + activemodel (= 5.2.8) + activesupport (= 5.2.8) arel (>= 9.0) - activerecord-import (1.1.0) - activerecord (>= 3.2) - activestorage (5.2.7.1) - actionpack (= 5.2.7.1) - activerecord (= 5.2.7.1) + activerecord-import (1.4.0) + activerecord (>= 4.2) + activestorage (5.2.8) + actionpack (= 5.2.8) + activerecord (= 5.2.8) marcel (~> 1.0.0) - activesupport (5.2.7.1) + activesupport (5.2.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -61,7 +61,7 @@ GEM capybara (~> 3.13, < 4) websocket-driver (>= 0.6.5) arel (9.0.0) - asset_sync (2.15.0) + asset_sync (2.15.2) activemodel (>= 4.1.0) fog-core mime-types (>= 2.99) @@ -70,13 +70,13 @@ GEM attr_encrypted (3.1.0) encryptor (~> 3.0.0) attr_required (1.0.1) - autoprefixer-rails (10.3.3.0) + autoprefixer-rails (10.4.7.0) execjs (~> 2) babel-source (5.8.35) babel-transpiler (0.7.0) babel-source (>= 4.0, < 6) execjs (~> 2.0) - bcrypt (3.1.16) + bcrypt (3.1.18) bindata (2.4.10) bootstrap-sass (3.4.1) autoprefixer-rails (>= 5.2.1) @@ -165,11 +165,11 @@ GEM cucumber-api-steps (0.14.0) cucumber (>= 2.0.2) jsonpath (>= 0.1.2) - cucumber-core (10.1.0) + cucumber-core (10.1.1) cucumber-gherkin (~> 22.0, >= 22.0.0) cucumber-messages (~> 17.1, >= 17.1.1) - cucumber-tag-expressions (~> 4.0, >= 4.0.2) - cucumber-create-meta (6.0.2) + cucumber-tag-expressions (~> 4.1, >= 4.1.0) + cucumber-create-meta (6.0.4) cucumber-messages (~> 17.1, >= 17.1.1) sys-uname (~> 1.2, >= 1.2.2) cucumber-cucumber-expressions (14.0.0) @@ -178,34 +178,33 @@ GEM cucumber-html-formatter (17.0.0) cucumber-messages (~> 17.1, >= 17.1.0) cucumber-messages (17.1.1) - cucumber-rails (2.4.0) + cucumber-rails (2.5.1) capybara (>= 2.18, < 4) cucumber (>= 3.2, < 8) mime-types (~> 3.3) nokogiri (~> 1.10) - railties (>= 5.0, < 7) + railties (>= 5.0, < 8) rexml (~> 3.0) webrick (~> 1.7) cucumber-tag-expressions (4.1.0) - cucumber-wire (6.2.0) + cucumber-wire (6.2.1) cucumber-core (~> 10.1, >= 10.1.0) cucumber-cucumber-expressions (~> 14.0, >= 14.0.0) - cucumber-messages (~> 17.1, >= 17.1.1) database_cleaner-active_record (2.0.1) activerecord (>= 5.a) database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) - devise (4.8.0) + devise (4.8.1) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - devise-two-factor (4.0.1) - activesupport (< 6.2) + devise-two-factor (4.0.2) + activesupport (< 7.1) attr_encrypted (>= 1.3, < 4, != 2) devise (~> 4.0) - railties (< 6.2) + railties (< 7.1) rotp (~> 6.0) devise_lastseenable (0.0.6) devise @@ -224,7 +223,7 @@ GEM diaspora_federation (= 0.2.7) fabrication (~> 2.16) uuid (~> 2.3, >= 2.3.8) - diff-lcs (1.4.4) + diff-lcs (1.5.0) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -237,11 +236,11 @@ GEM execjs multi_json (>= 1.3) rake - et-orbi (1.2.6) + et-orbi (1.2.7) tzinfo ethon (0.15.0) ffi (>= 1.15.0) - excon (0.88.0) + excon (0.92.3) execjs (2.8.1) eye (0.10.0) celluloid (~> 0.17.3) @@ -255,14 +254,14 @@ GEM factory_bot_rails (6.1.0) factory_bot (~> 6.1.0) railties (>= 5.0.0) - faraday (0.17.4) + faraday (0.17.5) multipart-post (>= 1.2, < 3) faraday-cookie_jar (0.0.7) faraday (>= 0.8.0) http-cookie (~> 1.0.0) faraday_middleware (0.14.0) faraday (>= 0.7.4, < 1.0) - ffi (1.15.4) + ffi (1.15.5) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake @@ -270,15 +269,14 @@ GEM activerecord (>= 2) activesupport (>= 2) hashdiff - fog-aws (3.12.0) + fog-aws (3.14.0) fog-core (~> 2.1) fog-json (~> 1.1) fog-xml (~> 0.1) - ipaddress (~> 0.8) - fog-core (2.2.4) + fog-core (2.3.0) builder excon (~> 0.71) - formatador (~> 0.2) + formatador (>= 0.2, < 2.0) mime-types fog-json (1.2.0) fog-core @@ -286,18 +284,18 @@ GEM fog-xml (0.1.4) fog-core nokogiri (>= 1.5.11, < 2.0.0) - formatador (0.3.0) - fugit (1.5.2) - et-orbi (~> 1.1, >= 1.1.8) + formatador (1.1.0) + fugit (1.5.3) + et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) fuubar (2.5.1) rspec-core (~> 3.0) ruby-progressbar (~> 1.4) get_process_mem (0.2.7) ffi (~> 1.0) - gitlab (4.17.0) + gitlab (4.18.0) httparty (~> 0.18) - terminal-table (~> 1.5, >= 1.5.1) + terminal-table (>= 1.5.1) globalid (1.0.0) activesupport (>= 5.0) gon (6.4.0) @@ -308,13 +306,13 @@ GEM haml (5.2.2) temple (>= 0.8.0) tilt - haml_lint (0.37.1) + haml_lint (0.40.0) haml (>= 4.0, < 5.3) parallel (~> 1.10) rainbow rubocop (>= 0.50.0) sysexits (~> 1.1) - hamlit (2.15.1) + hamlit (2.16.0) temple (>= 0.8.2) thor tilt @@ -323,13 +321,13 @@ GEM sprockets (>= 2.0.0) tilt (>= 1.2) hashdiff (1.0.1) - hashie (4.1.0) + hashie (5.0.0) http (4.4.1) addressable (~> 2.3) http-cookie (~> 1.0) http-form_data (~> 2.2) http-parser (~> 1.2.0) - http-cookie (1.0.4) + http-cookie (1.0.5) domain_name (~> 0.5) http-form_data (2.3.0) http-parser (1.2.3) @@ -349,10 +347,9 @@ GEM i18n-inflector (~> 2.6) railties (>= 3.0.0) idn-ruby (0.1.0) - image_processing (1.12.1) + image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - ipaddress (0.8.3) jasmine (3.10.0) jasmine-core (~> 3.10.0) phantomjs @@ -361,44 +358,41 @@ GEM webrick jasmine-core (3.10.1) jasmine-jquery-rails (2.0.3) - jquery-rails (4.4.0) + jquery-rails (4.5.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) - js-routes (2.1.2) + js-routes (2.2.4) railties (>= 4) js_image_paths (0.1.1) rails (>= 4.0, < 6.0) sprockets (>= 3.0.0) - json (2.3.0) + json (2.6.2) json-jwt (1.13.0) activesupport (>= 4.2) aes_key_wrap bindata - json-schema (2.8.1) - addressable (>= 2.4) - json-schema-rspec (0.0.4) - json-schema (~> 2.5) - rspec - jsonpath (1.1.0) + json-schema (3.0.0) + addressable (>= 2.8) + jsonpath (1.1.2) multi_json - jwt (2.3.0) + jwt (2.4.1) kgio (2.11.4) kostya-sigar (2.0.10) leaflet-rails (1.7.0) rails (>= 4.2.0) - listen (3.5.1) + listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) little-plugger (1.1.4) - logging (2.3.0) + logging (2.3.1) little-plugger (~> 1.1) multi_json (~> 1.14) logging-rails (0.6.0) logging (>= 1.8) - loofah (2.16.0) + loofah (2.18.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) macaddr (1.7.2) @@ -411,9 +405,9 @@ GEM memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) method_source (1.0.0) - mime-types (3.3.1) + mime-types (3.4.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0901) + mime-types-data (3.2022.0105) mini_magick (4.11.0) mini_mime (1.1.2) mini_portile2 (2.6.1) @@ -424,34 +418,35 @@ GEM multi_json (1.15.0) multi_test (0.1.2) multi_xml (0.6.0) - multipart-post (2.1.1) - mysql2 (0.5.3) + multipart-post (2.2.3) + mysql2 (0.5.4) naught (1.1.0) nio4r (2.5.8) nokogiri (1.12.5) mini_portile2 (~> 2.6.1) racc (~> 1.4) - oauth (0.5.7) - oauth2 (1.4.7) - faraday (>= 0.8, < 2.0) + oauth (0.5.10) + oauth2 (2.0.2) + faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) - multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - octokit (4.21.0) + rash_alt (>= 0.4, < 1) + version_gem (~> 1.0) + octokit (4.22.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) - omniauth (2.0.4) + omniauth (2.1.0) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) + rack (>= 2.2.3) rack-protection omniauth-oauth (1.2.0) oauth omniauth (>= 1.0, < 3) - omniauth-oauth2 (1.7.2) - oauth2 (~> 1.4) - omniauth (>= 1.9, < 3) - omniauth-rails_csrf_protection (1.0.0) + omniauth-oauth2 (1.8.0) + oauth2 (>= 1.4, < 3) + omniauth (~> 2.0) + omniauth-rails_csrf_protection (1.0.1) actionpack (>= 4.2) omniauth (~> 2.0) omniauth-tumblr (1.2) @@ -476,10 +471,10 @@ GEM validate_url webfinger (>= 1.0.1) orm_adapter (0.5.0) - parallel (1.21.0) - parser (3.0.2.0) + parallel (1.22.1) + parser (3.1.2.0) ast (~> 2.4.1) - pg (1.2.3) + pg (1.4.1) phantomjs (2.1.1.0) pronto (0.11.0) gitlab (~> 4.4, >= 4.4.0) @@ -492,10 +487,9 @@ GEM pronto-eslint (0.11.0) eslintrb (~> 2.0, >= 2.0.0) pronto (~> 0.11.0) - pronto-haml (0.11.0) + pronto-haml (0.11.1) haml_lint (~> 0.23) pronto (~> 0.11.0) - rubocop (< 1.0) pronto-rubocop (0.11.1) pronto (~> 0.11.0) rubocop (>= 0.63.1, < 2.0) @@ -508,10 +502,10 @@ GEM pry-byebug (3.8.0) byebug (~> 11.0) pry (~> 0.10) - public_suffix (4.0.6) + public_suffix (4.0.7) raabro (1.4.0) racc (1.6.0) - rack (2.2.3) + rack (2.2.3.1) rack-cors (1.1.1) rack (>= 2.0.0) rack-google-analytics (1.2.0) @@ -526,25 +520,25 @@ GEM json-jwt (>= 1.11.0) rack (>= 2.1.0) rack-piwik (0.3.0) - rack-protection (2.1.0) + rack-protection (2.2.0) rack rack-rewrite (1.5.1) rack-ssl (1.4.1) rack - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.7.1) - actioncable (= 5.2.7.1) - actionmailer (= 5.2.7.1) - actionpack (= 5.2.7.1) - actionview (= 5.2.7.1) - activejob (= 5.2.7.1) - activemodel (= 5.2.7.1) - activerecord (= 5.2.7.1) - activestorage (= 5.2.7.1) - activesupport (= 5.2.7.1) + rack-test (2.0.0) + rack (>= 1.3) + rails (5.2.8) + actioncable (= 5.2.8) + actionmailer (= 5.2.8) + actionpack (= 5.2.8) + actionview (= 5.2.8) + activejob (= 5.2.8) + activemodel (= 5.2.8) + activerecord (= 5.2.8) + activestorage (= 5.2.8) + activesupport (= 5.2.8) bundler (>= 1.3.0) - railties (= 5.2.7.1) + railties (= 5.2.8) sprockets-rails (>= 2.0.0) rails-assets-autosize (4.0.2) rails-assets-backbone (1.3.3) @@ -562,7 +556,7 @@ GEM rails-assets-jasmine (3.4.0) rails-assets-jasmine-ajax (4.0.0) rails-assets-jasmine (~> 3) - rails-assets-jquery (3.5.1) + rails-assets-jquery (3.6.0) rails-assets-jquery-placeholder (2.3.1) rails-assets-jquery (>= 1.6) rails-assets-jquery-textchange (0.2.3) @@ -587,54 +581,52 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) + rails-html-sanitizer (1.4.3) loofah (~> 2.3) rails-i18n (5.1.3) i18n (>= 0.7, < 2) railties (>= 5.0, < 6) - rails-timeago (2.19.1) - actionpack (>= 3.1) - activesupport (>= 3.1) - railties (5.2.7.1) - actionpack (= 5.2.7.1) - activesupport (= 5.2.7.1) + rails-timeago (2.20.0) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (5.2.8) + actionpack (= 5.2.8) + activesupport (= 5.2.8) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) - rainbow (3.0.0) - raindrops (0.19.2) + rainbow (3.1.1) + raindrops (0.20.0) rake (12.3.3) - rb-fsevent (0.11.0) + rash_alt (0.4.12) + hashie (>= 3.4) + rb-fsevent (0.11.1) rb-inotify (0.10.1) ffi (~> 1.0) redcarpet (3.5.1) - redis (4.5.1) - regexp_parser (2.1.1) - request_store (1.5.0) + redis (4.7.0) + regexp_parser (2.5.0) + request_store (1.5.1) rack (>= 1.4) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) rexml (3.2.5) rotp (6.2.0) - rqrcode (2.1.0) + rqrcode (2.1.1) chunky_png (~> 1.0) rqrcode_core (~> 1.0) rqrcode_core (1.2.0) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) + rspec-support (~> 3.11.0) rspec-json_expectations (2.2.0) - rspec-mocks (3.10.2) + rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (5.0.2) + rspec-support (~> 3.11.0) + rspec-rails (5.1.2) actionpack (>= 5.2) activesupport (>= 5.2) railties (>= 5.2) @@ -642,7 +634,7 @@ GEM rspec-expectations (~> 3.10) rspec-mocks (~> 3.10) rspec-support (~> 3.10) - rspec-support (3.10.3) + rspec-support (3.11.0) rubocop (0.93.1) parallel (~> 1.10) parser (>= 2.7.1.5) @@ -652,15 +644,15 @@ GEM rubocop-ast (>= 0.6.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (1.7.0) - parser (>= 3.0.1.1) + rubocop-ast (1.17.0) + parser (>= 3.1.1.0) rubocop-rails (2.9.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 0.90.0, < 2.0) - ruby-oembed (0.15.0) + ruby-oembed (0.16.1) ruby-progressbar (1.11.0) - ruby-vips (2.1.3) + ruby-vips (2.1.4) ffi (~> 1.12) rubyzip (2.3.2) rugged (1.0.1) @@ -682,12 +674,12 @@ GEM secure_headers (6.3.3) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) - sidekiq (6.2.2) + sidekiq (6.4.2) connection_pool (>= 2.2.2) rack (~> 2.0) redis (>= 4.2.0) - sidekiq-cron (1.2.0) - fugit (~> 1.1) + sidekiq-cron (1.4.0) + fugit (~> 1) sidekiq (>= 4.2.1) simple_captcha2 (0.5.0) rails (>= 4.1) @@ -697,7 +689,7 @@ GEM simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) - simplecov_json_formatter (0.1.3) + simplecov_json_formatter (0.1.4) sinon-rails (1.15.0) railties (>= 3.1) sprockets (3.7.2) @@ -707,9 +699,9 @@ GEM babel-source (>= 5.8.11) babel-transpiler sprockets (>= 3.0.0) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) sprockets (>= 3.0.0) ssrf_filter (1.0.7) state_machines (0.5.0) @@ -723,16 +715,16 @@ GEM sysexits (1.2.0) systemu (2.6.5) temple (0.8.2) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - terser (1.1.7) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + terser (1.1.10) execjs (>= 0.3.0, < 3) thor (1.2.1) thread_safe (0.3.6) tilt (2.0.10) - timecop (0.9.4) + timecop (0.9.5) timers (4.3.3) - toml-rb (2.1.0) + toml-rb (2.1.2) citrus (~> 3.0, > 3.0) turbo_dev_assets (0.0.2) twitter (7.0.0) @@ -755,9 +747,9 @@ GEM thread_safe (~> 0.1) unf (0.1.4) unf_ext - unf_ext (0.0.8) + unf_ext (0.0.8.2) unicode-display_width (1.8.0) - unicorn (6.0.0) + unicorn (6.1.0) kgio (~> 2.6) raindrops (~> 0.7) unicorn-worker-killer (0.4.5) @@ -769,9 +761,10 @@ GEM validate_email (0.1.6) activemodel (>= 3.0) mail (>= 2.2.5) - validate_url (1.0.13) + validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix + version_gem (1.1.0) versionist (2.0.1) activesupport (>= 3) railties (>= 3) @@ -793,20 +786,21 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) yajl-ruby (1.4.1) - yard (0.9.26) + yard (0.9.28) + webrick (~> 1.7.0) PLATFORMS ruby DEPENDENCIES - active_model_serializers (= 0.9.7) - activerecord-import (= 1.1.0) + active_model_serializers (= 0.9.8) + activerecord-import (= 1.4.0) acts-as-taggable-on (= 8.1.0) acts_as_api (= 1.0.1) addressable (= 2.8.0) apparition (= 0.6.0) - asset_sync (= 2.15.0) - autoprefixer-rails (= 10.3.3.0) + asset_sync (= 2.15.2) + autoprefixer-rails (= 10.4.7.0) bootstrap-sass (= 3.4.1) bootstrap-switch-rails (= 3.3.3) capybara (= 3.35.3) @@ -815,10 +809,10 @@ DEPENDENCIES compass-rails (= 3.1.0) configurate (= 0.5.0) cucumber-api-steps (= 0.14) - cucumber-rails (= 2.4.0) + cucumber-rails (= 2.5.1) database_cleaner-active_record (= 2.0.1) - devise (= 4.8.0) - devise-two-factor (= 4.0.1) + devise (= 4.8.1) + devise-two-factor (= 4.0.2) devise_lastseenable (= 0.0.6) diaspora_federation-json_schema (= 0.2.7) diaspora_federation-rails (= 0.2.7) @@ -826,48 +820,47 @@ DEPENDENCIES entypo-rails (= 3.0.0) eye (= 0.10.0) factory_bot_rails (= 6.1.0) - faraday (= 0.17.4) + faraday (= 0.17.5) faraday-cookie_jar (= 0.0.7) faraday_middleware (= 0.14.0) fixture_builder (= 0.5.2) - fog-aws (= 3.12.0) + fog-aws (= 3.14.0) fuubar (= 2.5.1) gon (= 6.4.0) - haml_lint (= 0.37.1) - hamlit (= 2.15.1) + haml_lint (= 0.40.0) + hamlit (= 2.16.0) handlebars_assets (= 0.23.9) http_accept_language (= 2.1.1) i18n-inflector-rails (= 1.0.7) jasmine (= 3.10.0) jasmine-jquery-rails (= 2.0.3) - jquery-rails (= 4.4.0) + jquery-rails (= 4.5.0) jquery-ui-rails (= 5.0.5) - js-routes (= 2.1.2) + js-routes (= 2.2.4) js_image_paths (= 0.1.1) - json (= 2.3.0) - json-schema (= 2.8.1) - json-schema-rspec (= 0.0.4) + json (= 2.6.2) + json-schema (= 3.0.0) leaflet-rails (= 1.7.0) - listen (= 3.5.1) + listen (= 3.7.1) logging-rails (= 0.6.0) markdown-it-html5-embed (= 1.0.0) markerb (= 1.1.0) mini_magick (= 4.11.0) - minitest + minitest (= 5.15.0) mobile-fu (= 1.4.0) - mysql2 (= 0.5.3) + mysql2 (= 0.5.4) nokogiri (= 1.12.5) - omniauth (= 2.0.4) - omniauth-rails_csrf_protection (= 1.0.0) + omniauth (= 2.1.0) + omniauth-rails_csrf_protection (= 1.0.1) omniauth-tumblr (= 1.2) omniauth-twitter (= 1.4.0) omniauth-wordpress (= 0.2.2) open_graph_reader (= 0.7.2) openid_connect (= 1.3.0) - pg (= 1.2.3) + pg (= 1.4.1) pronto (= 0.11.0) pronto-eslint (= 0.11.0) - pronto-haml (= 0.11.0) + pronto-haml (= 0.11.1) pronto-rubocop (= 0.11.1) pronto-scss (= 0.11.0) pry @@ -877,17 +870,18 @@ DEPENDENCIES rack-piwik (= 0.3.0) rack-rewrite (= 1.5.1) rack-ssl (= 1.4.1) - rails (= 5.2.7.1) + rails (= 5.2.8) rails-assets-autosize (= 4.0.2)! rails-assets-backbone (= 1.3.3)! rails-assets-blueimp-gallery (= 2.33.0)! + rails-assets-bootstrap (= 3.4.1)! rails-assets-bootstrap-markdown (= 2.10.0)! rails-assets-corejs-typeahead (= 1.2.1)! rails-assets-cropperjs (= 1.4.3)! rails-assets-fine-uploader (= 5.13.0)! rails-assets-highlightjs (= 9.12.0)! rails-assets-jasmine-ajax (= 4.0.0)! - rails-assets-jquery (= 3.5.1)! + rails-assets-jquery (= 3.6.0)! rails-assets-jquery-placeholder (= 2.3.1)! rails-assets-jquery-textchange (= 0.2.3)! rails-assets-jquery.are-you-sure (= 1.9.0)! @@ -903,36 +897,36 @@ DEPENDENCIES rails-assets-utatti-perfect-scrollbar (= 1.4.0)! rails-controller-testing (= 1.0.5) rails-i18n (= 5.1.3) - rails-timeago (= 2.19.1) + rails-timeago (= 2.20.0) redcarpet (= 3.5.1) - redis (= 4.5.1) + redis (= 4.7.0) responders (= 3.0.1) - rqrcode (= 2.1.0) + rqrcode (= 2.1.1) rspec-json_expectations (~> 2.1) - rspec-rails (= 5.0.2) + rspec-rails (= 5.1.2) rubocop (= 0.93.1) rubocop-rails (= 2.9.1) - ruby-oembed (= 0.15.0) + ruby-oembed (= 0.16.1) rubyzip (= 2.3.2) sass-rails (= 5.0.7) secure_headers (= 6.3.3) shoulda-matchers (= 4.5.1) - sidekiq (= 6.2.2) - sidekiq-cron (= 1.2.0) + sidekiq (= 6.4.2) + sidekiq-cron (= 1.4.0) simple_captcha2 (= 0.5.0) simplecov (= 0.21.2) sinon-rails (= 1.15.0) sprockets-es6 (= 0.9.2) - sprockets-rails (= 3.2.2) + sprockets-rails (= 3.4.2) string-direction (= 1.2.2) - terser (= 1.1.7) - timecop (= 0.9.4) - toml-rb (= 2.1.0) + terser (= 1.1.10) + timecop (= 0.9.5) + toml-rb (= 2.1.2) turbo_dev_assets (= 0.0.2) twitter (= 7.0.0) twitter-text (= 3.1.0) typhoeus (= 1.4.0) - unicorn (= 6.0.0) + unicorn (= 6.1.0) unicorn-worker-killer (= 0.4.5) uuid (= 2.3.9) versionist (= 2.0.1) diff --git a/config/sidekiq.yml b/config/sidekiq.yml index a99dd69c9..4ad8c3920 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -1,4 +1,4 @@ -<% require_relative 'config/load_config' %> +<% require_relative 'load_config' %> --- :verbose: false <% unless AppConfig.heroku? %> diff --git a/spec/integration/api/api_spec_helper.rb b/spec/integration/api/api_spec_helper.rb index 02f6c4bf9..b0d742c24 100644 --- a/spec/integration/api/api_spec_helper.rb +++ b/spec/integration/api/api_spec_helper.rb @@ -6,3 +6,8 @@ def confirm_api_error(response, code, message) expect(response.status).to eq(code) expect(JSON.parse(response.body)).to eq("code" => code, "message" => message) end + +def expect_to_match_json_schema(json, fragment) + errors = JSON::Validator.fully_validate("lib/schemas/api_v1.json", json, fragment: fragment) + expect(errors).to be_empty +end diff --git a/spec/integration/api/aspects_controller_spec.rb b/spec/integration/api/aspects_controller_spec.rb index 9661b288c..5c4ec45bd 100644 --- a/spec/integration/api/aspects_controller_spec.rb +++ b/spec/integration/api/aspects_controller_spec.rb @@ -46,7 +46,7 @@ describe Api::V1::AspectsController do expect(aspect["order"]).to eq(found_aspect.order_id) end - expect(aspects.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/aspects") + expect_to_match_json_schema(aspects.to_json, "#/definitions/aspects") end context "without impromper credentials" do @@ -81,7 +81,7 @@ describe Api::V1::AspectsController do expect(aspect["name"]).to eq(@aspect2.name) expect(aspect["order"]).to eq(@aspect2.order_id) - expect(aspect.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/aspect") + expect_to_match_json_schema(aspect.to_json, "#/definitions/aspect") end end diff --git a/spec/integration/api/comments_controller_spec.rb b/spec/integration/api/comments_controller_spec.rb index 9f8e08c7e..3c90195c9 100644 --- a/spec/integration/api/comments_controller_spec.rb +++ b/spec/integration/api/comments_controller_spec.rb @@ -156,7 +156,7 @@ describe Api::V1::CommentsController do confirm_comment_format(comments[1], auth.user, @comment_text2) expect(comments).to all(include("reported" => false)) - expect(comments.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/comments") + expect_to_match_json_schema(comments.to_json, "#/definitions/comments") end it "returns reported status of a comment" do diff --git a/spec/integration/api/contacts_controller_spec.rb b/spec/integration/api/contacts_controller_spec.rb index ccc8488a0..26571a9a8 100644 --- a/spec/integration/api/contacts_controller_spec.rb +++ b/spec/integration/api/contacts_controller_spec.rb @@ -58,7 +58,7 @@ describe Api::V1::ContactsController do contacts = response_body_data(response) expect(contacts.length).to eq(@aspect1.contacts.length) - expect(contacts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/users") + expect_to_match_json_schema(contacts.to_json, "#/definitions/users") end end diff --git a/spec/integration/api/conversations_controller_spec.rb b/spec/integration/api/conversations_controller_spec.rb index 9c69462a5..2ebf368c6 100644 --- a/spec/integration/api/conversations_controller_spec.rb +++ b/spec/integration/api/conversations_controller_spec.rb @@ -164,7 +164,7 @@ describe Api::V1::ConversationsController do actual_conversation = returned_conversations.select {|c| c["guid"] == @read_conversation_guid }[0] confirm_conversation_format(actual_conversation, @read_conversation, [auth.user, alice]) - expect(returned_conversations.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/conversations") + expect_to_match_json_schema(returned_conversations.to_json, "#/definitions/conversations") end it "returns all the user unread conversations" do @@ -230,7 +230,7 @@ describe Api::V1::ConversationsController do conversation = response_body(response) confirm_conversation_format(conversation, @conversation, [auth.user, alice]) - expect(conversation.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/conversation") + expect_to_match_json_schema(conversation.to_json, "#/definitions/conversation") end end @@ -283,7 +283,7 @@ describe Api::V1::ConversationsController do conversation = response_body(response) confirm_conversation_format(conversation, @conversation, [auth.user, alice]) - expect(conversation.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/conversation") + expect_to_match_json_schema(conversation.to_json, "#/definitions/conversation") end it "marks as unread and returns the corresponding conversation" do @@ -297,7 +297,7 @@ describe Api::V1::ConversationsController do conversation = response_body(response) confirm_conversation_format(conversation, @conversation, [auth.user, alice], read: false) - expect(conversation.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/conversation") + expect_to_match_json_schema(conversation.to_json, "#/definitions/conversation") end end diff --git a/spec/integration/api/likes_controller_spec.rb b/spec/integration/api/likes_controller_spec.rb index b65b54583..463919268 100644 --- a/spec/integration/api/likes_controller_spec.rb +++ b/spec/integration/api/likes_controller_spec.rb @@ -75,7 +75,7 @@ describe Api::V1::LikesController do confirm_like_format(likes, bob) confirm_like_format(likes, auth.user) - expect(likes.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/likes") + expect_to_match_json_schema(likes.to_json, "#/definitions/likes") end end diff --git a/spec/integration/api/messages_controller_spec.rb b/spec/integration/api/messages_controller_spec.rb index b292bdf50..944e22de6 100644 --- a/spec/integration/api/messages_controller_spec.rb +++ b/spec/integration/api/messages_controller_spec.rb @@ -132,7 +132,7 @@ describe Api::V1::MessagesController do messages = response_body_data(response) expect(messages.length).to eq(1) - expect(messages.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/messages") + expect_to_match_json_schema(messages.to_json, "#/definitions/messages") confirm_message_format(messages[0], "first message", auth.user) conversation = get_conversation(@conversation_guid) diff --git a/spec/integration/api/notifications_controller_spec.rb b/spec/integration/api/notifications_controller_spec.rb index 485f05113..ae7d3a20e 100644 --- a/spec/integration/api/notifications_controller_spec.rb +++ b/spec/integration/api/notifications_controller_spec.rb @@ -41,7 +41,7 @@ describe Api::V1::NotificationsController do expect(notifications.length).to eq(2) confirm_notification_format(notifications[1], @notification, "also_commented", nil) - expect(notifications.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/notifications") + expect_to_match_json_schema(notifications.to_json, "#/definitions/notifications") end it "with proper credentials and unread only" do @@ -73,7 +73,7 @@ describe Api::V1::NotificationsController do expect(notifications.length).to eq(2) confirm_notification_format(notifications[1], @notification, "also_commented", nil) - expect(notifications.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/notifications") + expect_to_match_json_schema(notifications.to_json, "#/definitions/notifications") end it "with proper credentials and after certain date" do @@ -133,7 +133,7 @@ describe Api::V1::NotificationsController do notification = JSON.parse(response.body) confirm_notification_format(notification, @notification, "also_commented", @post) - expect(notification.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/notification") + expect_to_match_json_schema(notification.to_json, "#/definitions/notification") end end diff --git a/spec/integration/api/photos_controller_spec.rb b/spec/integration/api/photos_controller_spec.rb index 970e3777d..5fee7151e 100644 --- a/spec/integration/api/photos_controller_spec.rb +++ b/spec/integration/api/photos_controller_spec.rb @@ -78,7 +78,7 @@ describe Api::V1::PhotosController do expect(photo.has_key?("post")).to be_falsey confirm_photo_format(photo, @user_photo1) - expect(photo.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/photo") + expect_to_match_json_schema(photo.to_json, "#/definitions/photo") end it "with correct GUID user's photo used in post and access token" do @@ -149,7 +149,7 @@ describe Api::V1::PhotosController do photos = response_body_data(response) expect(photos.length).to eq(2) - expect(photos.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/photos") + expect_to_match_json_schema(photos.to_json, "#/definitions/photos") end end diff --git a/spec/integration/api/posts_controller_spec.rb b/spec/integration/api/posts_controller_spec.rb index c7356ac35..e0e1886b2 100644 --- a/spec/integration/api/posts_controller_spec.rb +++ b/spec/integration/api/posts_controller_spec.rb @@ -74,7 +74,7 @@ describe Api::V1::PostsController do post = response_body(response) confirm_post_format(post, alice, @status, [bob, eve]) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end end @@ -101,7 +101,7 @@ describe Api::V1::PostsController do post = response_body(response) confirm_post_format(post, alice, status_message) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end end @@ -126,7 +126,7 @@ describe Api::V1::PostsController do expect(post["own_interaction_state"]["subscribed"]).to be true expect(post["own_interaction_state"]["reported"]).to be true - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end end @@ -143,7 +143,7 @@ describe Api::V1::PostsController do post = response_body(response) confirm_reshare_format(post, @status, alice) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end end @@ -238,7 +238,7 @@ describe Api::V1::PostsController do expect(response.status).to eq(200) post = response_body(response) confirm_post_format(post, auth.user, post_for_ref_only) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end it "or creates a private post" do @@ -261,7 +261,7 @@ describe Api::V1::PostsController do post = response_body(response) expect(response.status).to eq(200) confirm_post_format(post, auth.user, post_for_ref_only) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end it "doesn't creates a private post without private:modify scope in token" do @@ -305,7 +305,7 @@ describe Api::V1::PostsController do post_for_ref_only = StatusMessageCreationService.new(auth.user).create(merged_params) confirm_post_format(post, auth.user, post_for_ref_only) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end it "fails to add other's photos" do @@ -375,7 +375,7 @@ describe Api::V1::PostsController do post = response_body(response) expect(response.status).to eq(200) confirm_post_format(post, auth.user, post_for_ref_only) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end it "fails poll with no answers" do @@ -451,7 +451,7 @@ describe Api::V1::PostsController do post = response_body(response) expect(response.status).to eq(200) confirm_post_format(post, auth.user, post_for_ref_only) - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end it "creates with mentions" do @@ -490,7 +490,7 @@ describe Api::V1::PostsController do expect(response.status).to eq(200) post = response_body(response) expect(post["nsfw"]).to be_truthy - expect(post.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(post.to_json, "#/definitions/post") end end @@ -505,7 +505,7 @@ describe Api::V1::PostsController do } ) expect(response.status).to eq(200) - expect(response.body).to match_json_schema(:api_v1_schema, fragment: "#/definitions/post") + expect_to_match_json_schema(response.body, "#/definitions/post") end it "fails to add other's photos" do diff --git a/spec/integration/api/reshares_controller_spec.rb b/spec/integration/api/reshares_controller_spec.rb index b957fe9bc..40bc210d9 100644 --- a/spec/integration/api/reshares_controller_spec.rb +++ b/spec/integration/api/reshares_controller_spec.rb @@ -55,7 +55,7 @@ describe Api::V1::ResharesController do expect(reshare["guid"]).not_to be_nil confirm_person_format(reshare["author"], alice) - expect(reshares.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/reshares") + expect_to_match_json_schema(reshares.to_json, "#/definitions/reshares") end it "succeeds but empty with private post it can see" do diff --git a/spec/integration/api/search_controller_spec.rb b/spec/integration/api/search_controller_spec.rb index 0c98e698b..de63b33af 100644 --- a/spec/integration/api/search_controller_spec.rb +++ b/spec/integration/api/search_controller_spec.rb @@ -69,7 +69,7 @@ describe Api::V1::SearchController do users = response_body_data(response) expect(users.length).to eq(5) - expect(users.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/users") + expect_to_match_json_schema(users.to_json, "#/definitions/users") end it "succeeds by name" do @@ -81,7 +81,7 @@ describe Api::V1::SearchController do users = response_body_data(response) expect(users.length).to eq(1) - expect(users.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/users") + expect_to_match_json_schema(users.to_json, "#/definitions/users") end it "succeeds by handle" do @@ -93,7 +93,7 @@ describe Api::V1::SearchController do users = response_body_data(response) expect(users.length).to eq(1) - expect(users.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/users") + expect_to_match_json_schema(users.to_json, "#/definitions/users") end context "with a contacts filter" do @@ -424,7 +424,7 @@ describe Api::V1::SearchController do posts = response_body_data(response) expect(posts.length).to eq(2) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "only returns public posts without private scope" do @@ -478,7 +478,7 @@ describe Api::V1::SearchController do tags = response_body_data(response) expect(tags.size).to eq(3) - expect(tags.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/tags") + expect_to_match_json_schema(tags.to_json, "#/definitions/tags") end it "does a prefix search" do @@ -490,7 +490,7 @@ describe Api::V1::SearchController do tags = response_body_data(response) expect(tags.size).to eq(2) - expect(tags.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/tags") + expect_to_match_json_schema(tags.to_json, "#/definitions/tags") end it "fails with missing parameters" do diff --git a/spec/integration/api/streams_controller_spec.rb b/spec/integration/api/streams_controller_spec.rb index fa650664d..a5371fd55 100644 --- a/spec/integration/api/streams_controller_spec.rb +++ b/spec/integration/api/streams_controller_spec.rb @@ -84,7 +84,7 @@ describe Api::V1::StreamsController do posts = response_body_data(response) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "contains expected aspect message" do @@ -146,7 +146,7 @@ describe Api::V1::StreamsController do posts = response_body_data(response) expect(posts.length).to eq(3) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "public posts only tags expected" do @@ -185,7 +185,7 @@ describe Api::V1::StreamsController do expect(response.status).to eq(200) posts = response_body_data(response) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "contains activity message" do @@ -228,7 +228,7 @@ describe Api::V1::StreamsController do expect(response.status).to eq(200) posts = response_body_data(response) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "contains main message" do @@ -271,7 +271,7 @@ describe Api::V1::StreamsController do expect(response.status).to eq(200) posts = response_body_data(response) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "contains commented message" do @@ -312,7 +312,7 @@ describe Api::V1::StreamsController do expect(response.status).to eq(200) posts = response_body_data(response) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "contains mentions message" do @@ -353,7 +353,7 @@ describe Api::V1::StreamsController do expect(response.status).to eq(200) posts = response_body_data(response) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "contains liked message" do diff --git a/spec/integration/api/tag_followings_controller_spec.rb b/spec/integration/api/tag_followings_controller_spec.rb index c3bf30f66..9968af7fc 100755 --- a/spec/integration/api/tag_followings_controller_spec.rb +++ b/spec/integration/api/tag_followings_controller_spec.rb @@ -102,7 +102,7 @@ describe Api::V1::TagFollowingsController do expect(items.length).to eq(@expected_tags.length) @expected_tags.each {|tag| expect(items.find(tag)).to be_truthy } - expect(items.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/tags") + expect_to_match_json_schema(items.to_json, "#/definitions/tags") end end diff --git a/spec/integration/api/users_controller_spec.rb b/spec/integration/api/users_controller_spec.rb index a3833c06d..e44319376 100644 --- a/spec/integration/api/users_controller_spec.rb +++ b/spec/integration/api/users_controller_spec.rb @@ -65,7 +65,7 @@ describe Api::V1::UsersController do expect(user["guid"]).to eq(auth.user.guid) confirm_self_data_format(user) - expect(user.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/own_user") + expect_to_match_json_schema(user.to_json, "#/definitions/own_user") end it "fails if invalid token" do @@ -90,7 +90,7 @@ describe Api::V1::UsersController do expect(user["guid"]).to eq(alice.person.guid) confirm_public_profile_hash(user) - expect(user.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/user") + expect_to_match_json_schema(user.to_json, "#/definitions/user") end it "succeeds with in Aspect valid user" do @@ -107,7 +107,7 @@ describe Api::V1::UsersController do expect(user["guid"]).to eq(alice.person.guid) confirm_public_profile_hash(user) - expect(user.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/user") + expect_to_match_json_schema(user.to_json, "#/definitions/user") end it "succeeds with limited data on non-public/not shared" do @@ -134,7 +134,7 @@ describe Api::V1::UsersController do expect(user["guid"]).to eq(eve.person.guid) confirm_public_profile_hash(user) - expect(user.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/user") + expect_to_match_json_schema(user.to_json, "#/definitions/user") end it "fails if invalid token" do @@ -327,7 +327,7 @@ describe Api::V1::UsersController do expect(contacts.length).to eq(1) confirm_person_format(contacts[0], alice) - expect(contacts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/users") + expect_to_match_json_schema(contacts.to_json, "#/definitions/users") end it "fails with invalid GUID" do @@ -393,7 +393,7 @@ describe Api::V1::UsersController do expect(guids).not_to include(@private_photo1.guid) confirm_photos(photos) - expect(photos.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/photos") + expect_to_match_json_schema(photos.to_json, "#/definitions/photos") end it "returns only public photos of other user without private:read scope in token" do @@ -469,7 +469,7 @@ describe Api::V1::UsersController do post = posts.select {|p| p["guid"] == @public_post1.guid } confirm_post_format(post[0], alice, @public_post1) - expect(posts.to_json).to match_json_schema(:api_v1_schema, fragment: "#/definitions/posts") + expect_to_match_json_schema(posts.to_json, "#/definitions/posts") end it "returns logged in user's posts" do diff --git a/spec/integration/exporter_spec.rb b/spec/integration/exporter_spec.rb index ef3750179..e1134d3c0 100644 --- a/spec/integration/exporter_spec.rb +++ b/spec/integration/exporter_spec.rb @@ -16,7 +16,8 @@ describe Diaspora::Exporter do %i[generic_user_data activity status_messages_flavours work_aspect] ) - expect(JSON.parse(json)).to match_json_schema(:archive_schema) + errors = JSON::Validator.fully_validate(ArchiveValidator::SchemaValidator::JSON_SCHEMA, JSON.parse(json)) + expect(errors).to be_empty end it "contains basic user data" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8a6b9d585..e50ea8b09 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -140,10 +140,6 @@ RSpec.configure do |config| config.include FactoryBot::Syntax::Methods - config.include JSON::SchemaMatchers - config.json_schemas[:archive_schema] = ArchiveValidator::SchemaValidator::JSON_SCHEMA - config.json_schemas[:api_v1_schema] = "lib/schemas/api_v1.json" - JSON::Validator.add_schema( JSON::Schema.new( DiasporaFederation::Schemas.federation_entities,