diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be439e9..4ec3112 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: env: RAILS_ENV: test run: | - gem install bundler:2.3.23 + gem install bundler:2.5.22 bundle install --jobs 4 --retry 3 yarn install bundle exec rake db:setup diff --git a/Gemfile b/Gemfile index 643002c..417697e 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.3.14" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" -gem "rails", "~> 7.0.4" +gem "rails", "~> 8.1.0" # Application Dependencies gem "dotenv-rails" diff --git a/Gemfile.lock b/Gemfile.lock index 64a25ae..44a1a4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,79 +10,94 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + action_text-trix (2.1.19) + railties + actioncable (8.1.4.1) + actionpack (= 8.1.4.1) + activesupport (= 8.1.4.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) - mail (>= 2.7.1) - net-imap - net-pop - net-smtp - actionmailer (7.0.4) - actionpack (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activesupport (= 7.0.4) - mail (~> 2.5, >= 2.5.4) - net-imap - net-pop - net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) + zeitwerk (~> 2.6) + actionmailbox (8.1.4.1) + actionpack (= 8.1.4.1) + activejob (= 8.1.4.1) + activerecord (= 8.1.4.1) + activestorage (= 8.1.4.1) + activesupport (= 8.1.4.1) + mail (>= 2.8.0) + actionmailer (8.1.4.1) + actionpack (= 8.1.4.1) + actionview (= 8.1.4.1) + activejob (= 8.1.4.1) + activesupport (= 8.1.4.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.1.4.1) + actionview (= 8.1.4.1) + activesupport (= 8.1.4.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.1.4.1) + action_text-trix (~> 2.1.15) + actionpack (= 8.1.4.1) + activerecord (= 8.1.4.1) + activestorage (= 8.1.4.1) + activesupport (= 8.1.4.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) + actionview (8.1.4.1) + activesupport (= 8.1.4.1) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4) - activesupport (= 7.0.4) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6, >= 1.7.2) + activejob (8.1.4.1) + activesupport (= 8.1.4.1) globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) + activemodel (8.1.4.1) + activesupport (= 8.1.4.1) + activerecord (8.1.4.1) + activemodel (= 8.1.4.1) + activesupport (= 8.1.4.1) + timeout (>= 0.4.0) + activestorage (8.1.4.1) + actionpack (= 8.1.4.1) + activejob (= 8.1.4.1) + activerecord (= 8.1.4.1) + activesupport (= 8.1.4.1) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.1.4.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) + anonymous_loader (0.1.5) + version_gem (~> 1.1, >= 1.1.17) ast (2.4.2) - bcrypt (3.1.18) + auth-sanitizer (0.2.5) + version_gem (~> 1.1, >= 1.1.16) + base64 (0.3.0) + bcrypt (3.1.22) + bigdecimal (4.1.3) bindex (0.8.1) bootsnap (1.13.0) msgpack (~> 1.2) - builder (3.2.4) + builder (3.3.0) capybara (3.37.1) addressable matrix @@ -95,21 +110,22 @@ GEM childprocess (4.1.0) coderay (1.1.3) colorize (0.8.1) - concurrent-ruby (1.1.10) - connection_pool (2.3.0) - crass (1.0.6) + concurrent-ruby (1.3.8) + connection_pool (2.5.5) + crass (1.0.8) cssbundling-rails (1.1.1) railties (>= 6.0.0) + date (3.6.0) debug (1.6.2) irb (>= 1.3.6) reline (>= 0.3.1) - devise (4.8.1) + devise (5.0.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 4.1.0) + railties (>= 7.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) + diff-lcs (1.6.2) docile (1.4.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -119,7 +135,9 @@ GEM railties (>= 3.2) dotenv_validator (1.2.0) fast_blank (~> 1.0.0) - erubi (1.11.0) + drb (2.2.3) + erb (6.0.7) + erubi (1.13.1) ethon (0.15.0) ffi (>= 1.15.0) factory_bot (6.2.1) @@ -127,15 +145,20 @@ GEM factory_bot_rails (6.2.0) factory_bot (~> 6.2.0) railties (>= 5.0.0) - faraday (2.7.6) - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) + faraday (2.15.1) + faraday-net_http (>= 2.0, < 3.6) + json + logger + faraday-net_http (3.5.0) + net-http (~> 0.5) fast_blank (1.0.1) - ffi (1.15.5) + ffi (1.17.4-aarch64-linux-gnu) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) formatador (1.1.0) - globalid (1.0.0) - activesupport (>= 5.0) + globalid (1.4.0) + activesupport (>= 6.1) guard (2.18.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) @@ -150,33 +173,43 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - hashie (5.0.0) + hashie (5.2.0) + logger http-cookie (1.0.5) domain_name (~> 0.5) httparty (0.20.0) mime-types (~> 3.0) multi_xml (>= 0.5.2) - i18n (1.12.0) + i18n (1.15.2) concurrent-ruby (~> 1.0) iniparse (1.5.0) - io-console (0.5.11) - irb (1.4.2) - reline (>= 0.3.0) + io-console (0.9.5) + irb (1.19.0) + pp (>= 0.6.0) + prism (>= 1.3.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jsbundling-rails (1.0.3) railties (>= 6.0.0) json (2.6.2) - jwt (2.7.1) + jwt (3.3.0) + base64 kwalify (0.7.2) listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.19.0) + logger (1.7.0) + loofah (2.25.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.19.5) lumberjack (1.2.8) - mail (2.7.1) + mail (2.9.1) + logger mini_mime (>= 0.1.1) - marcel (1.0.2) + net-imap + net-pop + net-smtp + marcel (1.2.1) matrix (0.4.2) mechanize (2.8.5) addressable (~> 2.8) @@ -189,29 +222,36 @@ GEM rubyntlm (~> 0.6, >= 0.6.3) webrick (~> 1.7) webrobots (~> 0.1.2) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.4.1) mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) - mini_mime (1.1.2) - minitest (5.16.3) + mini_mime (1.1.5) + minitest (6.1.0) + drb (~> 2.0) + prism (>= 1.5, < 3) msgpack (1.6.0) - multi_xml (0.6.0) + multi_xml (0.9.1) + bigdecimal (>= 3.1, < 5) nenv (0.3.0) + net-http (0.10.0) + net-protocol (>= 0.3.0) + uri (>= 0.11.1) net-http-digest_auth (1.4.1) net-http-persistent (4.0.1) connection_pool (~> 2.2) - net-imap (0.3.1) + net-imap (0.6.8) + date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.1.3) + net-protocol (0.4.0) timeout - net-smtp (0.3.3) + net-smtp (0.5.2) net-protocol next_rails (1.2.1) colorize (>= 0.8.1) - nio4r (2.5.9) + nio4r (2.7.5) nokogiri (1.19.7-aarch64-linux-gnu) racc (~> 1.4) nokogiri (1.19.7-arm64-darwin) @@ -223,32 +263,42 @@ GEM notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - oauth2 (2.0.9) - faraday (>= 0.17.3, < 3.0) - jwt (>= 1.0, < 3.0) + oauth2 (2.1.0) + anonymous_loader (~> 0.1, >= 0.1.5) + auth-sanitizer (~> 0.2, >= 0.2.5) + faraday (>= 0.17.3, < 4.0) + jwt (>= 1.0, < 4.0) + logger (~> 1.2) multi_xml (~> 0.5) rack (>= 1.2, < 4) - snaky_hash (~> 2.0) - version_gem (~> 1.1) - ombu_labs-auth (1.0.0) - devise (~> 4.8.1) + snaky_hash (~> 2.0, >= 2.0.9) + version_gem (~> 1.1, >= 1.1.17) + ombu_labs-auth (1.2.0) + devise (>= 4.9) omniauth (~> 2.1.0) omniauth-github (~> 2.0.0) + omniauth-google-oauth2 (~> 1.1) omniauth-rails_csrf_protection rails (>= 6.0) ombu_labs-shortener (0.2.0) rebrandly - omniauth (2.1.1) + omniauth (2.1.4) hashie (>= 3.4.6) + logger rack (>= 2.2.3) rack-protection omniauth-github (2.0.1) omniauth (~> 2.0) omniauth-oauth2 (~> 1.8) - omniauth-oauth2 (1.8.0) - oauth2 (>= 1.4, < 3) + omniauth-google-oauth2 (1.2.3) + jwt (>= 2.9.2, < 4) + oauth2 (~> 2.0) + omniauth (~> 2.0) + omniauth-oauth2 (~> 1.8) + omniauth-oauth2 (1.9.0) + oauth2 (>= 2.0.2, < 3) omniauth (~> 2.0) - omniauth-rails_csrf_protection (1.0.1) + omniauth-rails_csrf_protection (2.0.1) actionpack (>= 4.2) omniauth (~> 2.0) orm_adapter (0.5.0) @@ -261,6 +311,13 @@ GEM parser (3.1.2.1) ast (~> 2.4.1) pg (1.4.3) + pp (0.6.4) + prettyprint + prettyprint (0.2.1) + prism (2.1.0-aarch64-linux-gnu) + prism (2.1.0-arm64-darwin) + prism (2.1.0-x86_64-darwin) + prism (2.1.0-x86_64-linux-gnu) propshaft (0.6.4) actionpack (>= 7.0.0) activesupport (>= 7.0.0) @@ -273,46 +330,66 @@ GEM puma (8.1.2) nio4r (~> 2.0) racc (1.8.1) - rack (2.2.25) - rack-protection (3.0.6) - rack - rack-test (2.0.2) + rack (3.2.9) + rack-protection (4.2.2) + base64 (>= 0.1.0) + logger (>= 1.6.0) + rack (>= 3.0.0, < 4) + rack-session (2.1.2) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.3.0) rack (>= 1.3) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rackup (2.3.1) + rack (>= 3) + rails (8.1.4.1) + actioncable (= 8.1.4.1) + actionmailbox (= 8.1.4.1) + actionmailer (= 8.1.4.1) + actionpack (= 8.1.4.1) + actiontext (= 8.1.4.1) + actionview (= 8.1.4.1) + activejob (= 8.1.4.1) + activemodel (= 8.1.4.1) + activerecord (= 8.1.4.1) + activestorage (= 8.1.4.1) + activesupport (= 8.1.4.1) bundler (>= 1.15.0) - railties (= 7.0.4) + railties (= 8.1.4.1) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) - method_source + rails-html-sanitizer (1.7.2) + loofah (~> 2.25, >= 2.25.3) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.1.4.1) + actionpack (= 8.1.4.1) + activesupport (= 8.1.4.1) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) + rake (13.4.2) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) + rbs (4.2.0) + logger + prism (>= 1.6.0) + tsort + rdoc (8.1.0) + erb + prism (>= 1.6.0) + rbs (>= 4.0.0) + tsort rebrandly (0.1.5) httparty (~> 0.14) reek (6.1.1) @@ -320,33 +397,33 @@ GEM parser (~> 3.1.0) rainbow (>= 2.0, < 4.0) regexp_parser (2.6.0) - reline (0.3.1) + reline (0.7.0) io-console (~> 0.5) - responders (3.1.0) - actionpack (>= 5.2) - railties (>= 5.2) + responders (3.2.1) + actionpack (>= 7.0) + railties (>= 7.0) rexml (3.2.5) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.1) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.7) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.6) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.1) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.9) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.11.1) + rspec-support (~> 3.13.0) + rspec-rails (7.1.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.8) rubocop (1.35.1) json (~> 2.3) parallel (~> 1.10) @@ -369,9 +446,9 @@ GEM rubocop-rspec (2.13.2) rubocop (~> 1.33) ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) rubyntlm (0.6.3) rubyzip (2.3.2) + securerandom (0.4.1) selenium-webdriver (4.5.0) childprocess (>= 0.5, < 5.0) rexml (~> 3.2, >= 3.2.5) @@ -384,9 +461,9 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - snaky_hash (2.0.1) - hashie - version_gem (~> 1.1, >= 1.1.1) + snaky_hash (2.0.9) + hashie (>= 0.1.0, < 6) + version_gem (~> 1.1, >= 1.1.16) standard (1.16.1) rubocop (= 1.35.1) rubocop-performance (= 1.14.3) @@ -400,17 +477,20 @@ GEM railties (>= 6.0.0) tailwindcss-rails (2.0.16-x86_64-linux) railties (>= 6.0.0) - thor (1.2.1) - timeout (0.3.0) + thor (1.5.0) + timeout (0.6.1) + tsort (0.2.0) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext unf_ext (0.0.8.2) unicode-display_width (2.3.0) - version_gem (1.1.3) + uri (1.1.2) + useragent (0.16.11) + version_gem (1.1.17) warden (1.2.9) rack (>= 2.0.9) web-console (4.2.0) @@ -425,12 +505,13 @@ GEM webrick (1.7.0) webrobots (0.1.2) websocket (1.2.9) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) + websocket-driver (0.9.0) + base64 + websocket-extensions (>= 0.2.0) + websocket-extensions (0.2.0) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.4) + zeitwerk (2.8.3) PLATFORMS aarch64-linux @@ -461,7 +542,7 @@ DEPENDENCIES pg (~> 1.1) propshaft puma (~> 8.1) - rails (~> 7.0.4) + rails (~> 8.1.0) rails-controller-testing reek rspec-rails @@ -481,4 +562,4 @@ RUBY VERSION ruby 3.3.14p208 BUNDLED WITH - 2.3.23 + 2.5.22 diff --git a/app/controllers/personal_access_tokens_controller.rb b/app/controllers/personal_access_tokens_controller.rb index 4c6263e..d7dfc36 100644 --- a/app/controllers/personal_access_tokens_controller.rb +++ b/app/controllers/personal_access_tokens_controller.rb @@ -14,7 +14,7 @@ def create render :index, status: :created else @personal_access_tokens = current_user.personal_access_tokens.order(created_at: :desc) - render :index, status: :unprocessable_entity + render :index, status: :unprocessable_content end end diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb index ef996ac..b87422b 100644 --- a/app/controllers/shares_controller.rb +++ b/app/controllers/shares_controller.rb @@ -37,8 +37,8 @@ def create format.html { redirect_to @link, notice: "Share was successfully created." } format.json { render json: share_json(@share), status: :created } else - format.html { render :new, status: :unprocessable_entity } - format.json { render json: { errors: @share.errors.full_messages }, status: :unprocessable_entity } + format.html { render :new, status: :unprocessable_content } + format.json { render json: { errors: @share.errors.full_messages }, status: :unprocessable_content } end end end diff --git a/app/controllers/social_media_snippets_controller.rb b/app/controllers/social_media_snippets_controller.rb index 8bb5e88..e9097a4 100644 --- a/app/controllers/social_media_snippets_controller.rb +++ b/app/controllers/social_media_snippets_controller.rb @@ -21,7 +21,7 @@ def create if @snippet.save render json: snippet_json(@snippet), status: :created else - render json: { errors: @snippet.errors.full_messages }, status: :unprocessable_entity + render json: { errors: @snippet.errors.full_messages }, status: :unprocessable_content end end end diff --git a/config/database.yml b/config/database.yml index 97f65dd..901fb52 100644 --- a/config/database.yml +++ b/config/database.yml @@ -19,7 +19,7 @@ default: &default encoding: unicode # For details on connection pooling, see Rails configuration guide # https://guides.rubyonrails.org/configuring.html#database-pooling - pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> + max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> port: <%= ENV.fetch("POSTGRES_PORT", 5432 )%> host: <%= ENV.fetch("POSTGRES_HOST", "localhost") %> username: postgres diff --git a/config/environments/development.rb b/config/environments/development.rb index 22ed1b5..776444e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -6,7 +6,7 @@ # In the development environment your application's code is reloaded any time # it changes. This slows down response time but is perfect for development # since you don't have to restart the web server when you make code changes. - config.cache_classes = false + config.enable_reloading = true # Do not eager load code on boot. config.eager_load = false diff --git a/config/environments/production.rb b/config/environments/production.rb index b09ea2c..5d483e0 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -4,7 +4,7 @@ # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers diff --git a/config/environments/test.rb b/config/environments/test.rb index eb2f171..2439c4d 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -9,7 +9,7 @@ # Settings specified here will take precedence over those in config/application.rb. # Turn false under Spring and add config.action_view.cache_template_loading = true. - config.cache_classes = true + config.enable_reloading = false # Eager loading loads your whole application. When running a single test locally, # this probably isn't necessary. It's a good idea to do in a continuous integration @@ -28,7 +28,7 @@ config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. - config.action_dispatch.show_exceptions = false + config.action_dispatch.show_exceptions = :none # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 0603156..3a00cc2 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -32,7 +32,7 @@ end RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_paths = ["#{::Rails.root}/spec/fixtures"] # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false diff --git a/spec/requests/api_links_spec.rb b/spec/requests/api_links_spec.rb index c46175e..4c8fe0f 100644 --- a/spec/requests/api_links_spec.rb +++ b/spec/requests/api_links_spec.rb @@ -163,7 +163,7 @@ headers: auth_headers }.not_to change(Share, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) body = JSON.parse(response.body) expect(body['errors']).to be_an(Array).and(be_present) end diff --git a/spec/requests/api_social_media_snippets_spec.rb b/spec/requests/api_social_media_snippets_spec.rb index 7cccdef..fb17b04 100644 --- a/spec/requests/api_social_media_snippets_spec.rb +++ b/spec/requests/api_social_media_snippets_spec.rb @@ -97,7 +97,7 @@ def post_snippet(params, headers: auth_headers, to: link) post_snippet({ social_media_snippet: { social_media_type: 'LinkedIn', content: '' } }) }.not_to change(SocialMediaSnippet, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(JSON.parse(response.body)['errors']).to include("Content can't be blank") end @@ -106,14 +106,14 @@ def post_snippet(params, headers: auth_headers, to: link) post_snippet({ social_media_snippet: { social_media_type: 'Myspace', content: 'Hello' } }) }.not_to change(SocialMediaSnippet, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(JSON.parse(response.body)['errors']).to include('Social media type is not included in the list') end it 'returns 422 when the social media type is missing' do post_snippet({ social_media_snippet: { content: 'Hello' } }) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(JSON.parse(response.body)['errors']).to include("Social media type can't be blank") end @@ -122,7 +122,7 @@ def post_snippet(params, headers: auth_headers, to: link) expect { post_snippet(valid_params) }.not_to change(SocialMediaSnippet, :count) - expect(response).to have_http_status(:unprocessable_entity) + expect(response).to have_http_status(:unprocessable_content) expect(JSON.parse(response.body)['errors'].first).to match(/has already been saved/) end