From c9de68abd5008de7c7baf2f6f64be940a98b6381 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 29 Jun 2024 11:21:11 +0300 Subject: [PATCH] Bump stuff. Rubocop offends --- .github/workflows/shizoid.yml | 2 +- .rubocop_todo.yml | 14 - .ruby-version | 2 +- Dockerfile | 2 +- Gemfile | 2 +- Gemfile.lock | 274 +++++++++--------- config/deploy/Containerfile | 2 +- .../application_controller_renderer.rb | 1 + config/initializers/mime_types.rb | 1 + db/seeds.rb | 1 + spec/factories/telegram/leftovers.rb | 2 + spec/models/chat_spec.rb | 8 +- spec/models/participation_spec.rb | 4 +- spec/processors/concerns/processor_spec.rb | 6 +- .../message_processor/binary_dice_spec.rb | 2 +- .../message_processor/eightball_spec.rb | 8 +- spec/processors/message_processor/gab_spec.rb | 10 +- .../processors/message_processor/help_spec.rb | 10 +- spec/processors/message_processor/ids_spec.rb | 10 +- spec/processors/message_processor/me_spec.rb | 12 +- .../processors/message_processor/ping_spec.rb | 10 +- spec/processors/message_processor/say_spec.rb | 12 +- .../message_processor/start_spec.rb | 8 +- .../message_processor/status_spec.rb | 10 +- .../processors/message_processor/stop_spec.rb | 8 +- .../processors/message_processor/text_spec.rb | 8 +- .../message_processor/winner_spec.rb | 4 +- spec/rails_helper.rb | 4 +- 28 files changed, 206 insertions(+), 231 deletions(-) diff --git a/.github/workflows/shizoid.yml b/.github/workflows/shizoid.yml index a05219f..c4b1d33 100644 --- a/.github/workflows/shizoid.yml +++ b/.github/workflows/shizoid.yml @@ -31,7 +31,7 @@ jobs: - name: 'Setup Ruby' uses: ruby/setup-ruby@v1 with: - ruby-version: 3.3.1 + ruby-version: 3.3.3 - name: "Install required system packages" run: sudo apt-get update -y && sudo apt-get install openssh-client rsync libpq-dev cmake -y - name: "Bundle install" diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index df5b769..367e465 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -44,20 +44,6 @@ Naming/AccessorMethodName: RSpec/ExampleLength: Max: 11 -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Include. -# Include: spec/factories.rb, spec/factories/**/*.rb, features/support/factories/**/*.rb -RSpec/FactoryBot/FactoryClassName: - Exclude: - - 'spec/factories/chat.rb' - - 'spec/factories/participation.rb' - - 'spec/factories/telegram/chat.rb' - - 'spec/factories/telegram/chat_photo.rb' - - 'spec/factories/telegram/update.rb' - - 'spec/factories/telegram/user.rb' - - 'spec/factories/user.rb' - # Offense count: 1 # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. # Include: **/*_spec*rb*, **/spec/**/* diff --git a/.ruby-version b/.ruby-version index bea438e..619b537 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.1 +3.3.3 diff --git a/Dockerfile b/Dockerfile index 21709bd..f3b3493 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:3.3.1-alpine +FROM ruby:3.3.3-alpine EXPOSE 3000 WORKDIR /opt/app/src diff --git a/Gemfile b/Gemfile index 1143128..6f8fd3b 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '3.3.1' +ruby '3.3.3' gem 'faraday' gem 'pg' diff --git a/Gemfile.lock b/Gemfile.lock index e1e76a3..ff63e9e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,86 +1,87 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) + actioncable (7.0.8.4) + actionpack (= 7.0.8.4) + activesupport (= 7.0.8.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + actionmailbox (7.0.8.4) + actionpack (= 7.0.8.4) + activejob (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.8.1) - actionpack (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activesupport (= 7.0.8.1) + actionmailer (7.0.8.4) + actionpack (= 7.0.8.4) + actionview (= 7.0.8.4) + activejob (= 7.0.8.4) + activesupport (= 7.0.8.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.8.1) - actionview (= 7.0.8.1) - activesupport (= 7.0.8.1) + actionpack (7.0.8.4) + actionview (= 7.0.8.4) + activesupport (= 7.0.8.4) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.8.1) - actionpack (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + actiontext (7.0.8.4) + actionpack (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.8.1) - activesupport (= 7.0.8.1) + actionview (7.0.8.4) + activesupport (= 7.0.8.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.8.1) - activesupport (= 7.0.8.1) + activejob (7.0.8.4) + activesupport (= 7.0.8.4) globalid (>= 0.3.6) - activemodel (7.0.8.1) - activesupport (= 7.0.8.1) - activerecord (7.0.8.1) - activemodel (= 7.0.8.1) - activesupport (= 7.0.8.1) - activestorage (7.0.8.1) - actionpack (= 7.0.8.1) - activejob (= 7.0.8.1) - activerecord (= 7.0.8.1) - activesupport (= 7.0.8.1) + activemodel (7.0.8.4) + activesupport (= 7.0.8.4) + activerecord (7.0.8.4) + activemodel (= 7.0.8.4) + activesupport (= 7.0.8.4) + activestorage (7.0.8.4) + actionpack (= 7.0.8.4) + activejob (= 7.0.8.4) + activerecord (= 7.0.8.4) + activesupport (= 7.0.8.4) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.8.1) + activesupport (7.0.8.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) axiom-types (0.1.1) descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) - bigdecimal (3.1.7) - builder (3.2.4) + bigdecimal (3.1.8) + builder (3.3.0) coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.3) connection_pool (2.4.1) - crack (0.4.5) + crack (1.0.0) + bigdecimal rexml crass (1.0.6) database_cleaner (2.0.2) @@ -90,7 +91,7 @@ GEM database_cleaner-core (~> 2.0.0) database_cleaner-core (2.0.1) date (3.3.4) - debug (1.9.1) + debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) descendants_tracker (0.0.4) @@ -98,7 +99,7 @@ GEM diff-lcs (1.5.1) docile (1.4.0) dry-inflector (0.2.1) - erubi (1.12.0) + erubi (1.13.0) et-orbi (1.2.7) tzinfo factory_bot (6.4.6) @@ -106,31 +107,14 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (1.10.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) + faraday (2.9.2) + faraday-net_http (>= 2.0, < 3.2) faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) + faraday-net_http (3.1.0) + net-http ffaker (2.23.0) - ffi (1.16.3) + ffi (1.17.0) formatador (1.1.0) fugit (1.9.0) et-orbi (~> 1, >= 1.2.7) @@ -161,15 +145,15 @@ GEM guard-rubocop (1.5.0) guard (~> 2.0) rubocop (< 2.0) - hashdiff (1.0.1) + hashdiff (1.1.0) i18n (1.14.5) concurrent-ruby (~> 1.0) ice_nine (0.11.2) io-console (0.7.2) - irb (1.12.0) - rdoc + irb (1.13.2) + rdoc (>= 4.0.0) reline (>= 0.4.2) - json (2.7.1) + json (2.7.2) language_server-protocol (3.17.0.3) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) @@ -186,28 +170,29 @@ GEM marcel (1.0.4) method_source (1.1.0) mini_mime (1.1.5) - mini_portile2 (2.8.6) - minitest (5.22.3) - multipart-post (2.4.0) + mini_portile2 (2.8.7) + minitest (5.24.0) + multipart-post (2.4.1) nenv (0.3.0) - net-imap (0.4.11) + net-http (0.4.1) + uri + net-imap (0.4.14) date net-protocol net-pop (0.1.2) - net-protocol net-protocol (0.2.2) timeout net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.4) + nokogiri (1.16.6) mini_portile2 (~> 2.8.2) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - parallel (1.24.0) - parser (3.3.0.5) + parallel (1.25.1) + parser (3.3.3.0) ast (~> 2.4.1) racc pg (1.5.6) @@ -216,28 +201,28 @@ GEM method_source (~> 1.0) psych (5.1.2) stringio - public_suffix (4.0.7) + public_suffix (6.0.0) puma (6.4.2) nio4r (~> 2.0) raabro (1.4.0) - racc (1.7.3) + racc (1.8.0) rack (2.2.9) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.8.1) - actioncable (= 7.0.8.1) - actionmailbox (= 7.0.8.1) - actionmailer (= 7.0.8.1) - actionpack (= 7.0.8.1) - actiontext (= 7.0.8.1) - actionview (= 7.0.8.1) - activejob (= 7.0.8.1) - activemodel (= 7.0.8.1) - activerecord (= 7.0.8.1) - activestorage (= 7.0.8.1) - activesupport (= 7.0.8.1) + rails (7.0.8.4) + actioncable (= 7.0.8.4) + actionmailbox (= 7.0.8.4) + actionmailer (= 7.0.8.4) + actionpack (= 7.0.8.4) + actiontext (= 7.0.8.4) + actionview (= 7.0.8.4) + activejob (= 7.0.8.4) + activemodel (= 7.0.8.4) + activerecord (= 7.0.8.4) + activestorage (= 7.0.8.4) + activesupport (= 7.0.8.4) bundler (>= 1.15.0) - railties (= 7.0.8.1) + railties (= 7.0.8.4) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -245,9 +230,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.0.8.1) - actionpack (= 7.0.8.1) - activesupport (= 7.0.8.1) + railties (7.0.8.4) + actionpack (= 7.0.8.4) + activesupport (= 7.0.8.4) method_source rake (>= 12.2) thor (~> 1.0) @@ -255,43 +240,46 @@ GEM rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.6.3.1) + rdoc (6.7.0) psych (>= 4.0.0) - redis (5.1.0) - redis-client (>= 0.17.0) - redis-client (0.21.1) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.2) connection_pool - regexp_parser (2.9.0) - reline (0.5.0) + regexp_parser (2.9.2) + reline (0.5.9) io-console (~> 0.5) - rexml (3.2.6) + rexml (3.3.1) + strscan rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) - rspec-expectations (3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.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-sidekiq (3.1.0) - rspec-core (~> 3.0, >= 3.0.0) - sidekiq (>= 2.4.0) + rspec-rails (6.1.3) + actionpack (>= 6.1) + activesupport (>= 6.1) + railties (>= 6.1) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-sidekiq (5.0.0) + rspec-core (~> 3.0) + rspec-expectations (~> 3.0) + rspec-mocks (~> 3.0) + sidekiq (>= 5, < 8) rspec-support (3.13.1) - rubocop (1.62.1) + rubocop (1.64.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -302,34 +290,27 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) - rubocop-capybara (2.20.0) - rubocop (~> 1.41) - rubocop-factory_bot (2.25.1) - rubocop (~> 1.41) - rubocop-performance (1.20.2) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-performance (1.21.1) rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rails (2.24.1) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (2.27.1) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) + rubocop-rspec (3.0.1) + rubocop (~> 1.61) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - sentry-rails (5.17.1) + sentry-rails (5.18.0) railties (>= 5.0) - sentry-ruby (~> 5.17.1) - sentry-ruby (5.17.1) + sentry-ruby (~> 5.18.0) + sentry-ruby (5.18.0) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - sentry-sidekiq (5.17.1) - sentry-ruby (~> 5.17.1) + sentry-sidekiq (5.18.0) + sentry-ruby (~> 5.18.0) sidekiq (>= 3.0) shellany (0.0.1) shoulda-matchers (6.2.0) @@ -350,10 +331,12 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - stringio (3.1.0) - telegram-bot-ruby (0.19.2) + stringio (3.1.1) + strscan (3.1.0) + telegram-bot-ruby (0.23.0) dry-inflector - faraday (~> 1.0) + faraday (~> 2.0) + faraday-multipart (~> 1.0) virtus (~> 2.0) thor (1.3.1) thread_safe (0.3.6) @@ -361,18 +344,19 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + uri (0.13.0) virtus (2.0.0) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) - webmock (3.14.0) + webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.13) + zeitwerk (2.6.16) PLATFORMS ruby @@ -415,7 +399,7 @@ DEPENDENCIES webmock RUBY VERSION - ruby 3.3.1p55 + ruby 3.3.3p89 BUNDLED WITH - 2.5.5 + 2.5.11 diff --git a/config/deploy/Containerfile b/config/deploy/Containerfile index a2259a6..f983bdd 100644 --- a/config/deploy/Containerfile +++ b/config/deploy/Containerfile @@ -1,4 +1,4 @@ -FROM docker.io/ruby:3.3.1-alpine +FROM docker.io/ruby:3.3.3-alpine EXPOSE 3000 WORKDIR /opt/app/src ENV LANG ru_RU.utf8 diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb index f4556db..6d56e43 100644 --- a/config/initializers/application_controller_renderer.rb +++ b/config/initializers/application_controller_renderer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 6e1d16f..be6fedc 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/db/seeds.rb b/db/seeds.rb index 8744e3c..8661206 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # diff --git a/spec/factories/telegram/leftovers.rb b/spec/factories/telegram/leftovers.rb index 25506bd..c15927c 100644 --- a/spec/factories/telegram/leftovers.rb +++ b/spec/factories/telegram/leftovers.rb @@ -1,4 +1,6 @@ # frozen_string_literal: true + +# # FactoryBot.define do # factory :tg_callback_query, class: Telegram::Bot::Types::CallbackQuery do # end diff --git a/spec/models/chat_spec.rb b/spec/models/chat_spec.rb index 4b20ed0..84dae83 100644 --- a/spec/models/chat_spec.rb +++ b/spec/models/chat_spec.rb @@ -101,15 +101,15 @@ end it 'enable!' do - expect(disabled_chat.disabled?).to eq true + expect(disabled_chat).to be_disabled disabled_chat.enable! - expect(disabled_chat.enabled?).to eq true + expect(disabled_chat).to be_enabled end it 'disable!' do - expect(chat.disabled?).to eq false + expect(chat).not_to be_disabled chat.disable! - expect(chat.enabled?).to eq false + expect(chat).not_to eq be_enabled end end diff --git a/spec/models/participation_spec.rb b/spec/models/participation_spec.rb index 2fc3042..5c612c4 100644 --- a/spec/models/participation_spec.rb +++ b/spec/models/participation_spec.rb @@ -21,7 +21,7 @@ user expect { described_class.learn(message) }.to change(described_class, :count).by(1) last = described_class.last - expect(last.left?).to eq false + expect(last).not_to be_left expect(last.active_at).not_to be_nil end @@ -30,7 +30,7 @@ user participation expect { described_class.learn(leave_message) }.not_to change(described_class, :count) - expect(participation.reload.left?).to eq true + expect(participation.reload).to be_left end end end diff --git a/spec/processors/concerns/processor_spec.rb b/spec/processors/concerns/processor_spec.rb index bedfe64..8dcd5f9 100644 --- a/spec/processors/concerns/processor_spec.rb +++ b/spec/processors/concerns/processor_spec.rb @@ -25,16 +25,16 @@ def process! it 'reponds to active chat' do respond = instance.responds? - expect(respond).to eq true + expect(respond).to be true end it "doesn't respond to inactive chat" do respond = described_class.new(inactive_command).responds? - expect(respond).to eq false + expect(respond).to be false end it '#command?' do - expect(instance.send(:command?)).to eq true + expect(instance.send(:command?)).to be true end describe '#command' do diff --git a/spec/processors/message_processor/binary_dice_spec.rb b/spec/processors/message_processor/binary_dice_spec.rb index c391bea..b9b99a7 100644 --- a/spec/processors/message_processor/binary_dice_spec.rb +++ b/spec/processors/message_processor/binary_dice_spec.rb @@ -15,7 +15,7 @@ let(:text) { FFaker::Lorem.sentence } it 'does nothing' do - expect(process_method).to eq nil + expect(process_method).to be_nil end end diff --git a/spec/processors/message_processor/eightball_spec.rb b/spec/processors/message_processor/eightball_spec.rb index a5a5c34..f9680d3 100644 --- a/spec/processors/message_processor/eightball_spec.rb +++ b/spec/processors/message_processor/eightball_spec.rb @@ -31,20 +31,20 @@ it 'has message model trait' do text_starts_with = eightball.text.starts_with? '/eightball' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'non eightball command' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end diff --git a/spec/processors/message_processor/gab_spec.rb b/spec/processors/message_processor/gab_spec.rb index 656b57b..078c2d6 100644 --- a/spec/processors/message_processor/gab_spec.rb +++ b/spec/processors/message_processor/gab_spec.rb @@ -17,25 +17,25 @@ it 'has message model trait' do text_starts_with = gab.text.starts_with? '/gab' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do chat.disable! - expect(described_class.new(gab).responds?).to eq false + expect(described_class.new(gab).responds?).to be false end it 'non /gab command' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end diff --git a/spec/processors/message_processor/help_spec.rb b/spec/processors/message_processor/help_spec.rb index 8095a8e..3c83a01 100644 --- a/spec/processors/message_processor/help_spec.rb +++ b/spec/processors/message_processor/help_spec.rb @@ -15,25 +15,25 @@ it 'has message model trait' do text_starts_with = help.text.starts_with? '/help' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do chat.disable! - expect(described_class.new(help).responds?).to eq false + expect(described_class.new(help).responds?).to be false end it 'non /help command' do - expect(described_class.new(me).responds?).to eq false + expect(described_class.new(me).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end diff --git a/spec/processors/message_processor/ids_spec.rb b/spec/processors/message_processor/ids_spec.rb index 477bd95..6c854fa 100644 --- a/spec/processors/message_processor/ids_spec.rb +++ b/spec/processors/message_processor/ids_spec.rb @@ -15,25 +15,25 @@ it 'has message model trait' do text_starts_with = ids.text.starts_with? '/ids' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do chat.disable! - expect(described_class.new(ids).responds?).to eq true + expect(described_class.new(ids).responds?).to be true end it 'non /ids command' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end diff --git a/spec/processors/message_processor/me_spec.rb b/spec/processors/message_processor/me_spec.rb index 07ed7af..4bf7996 100644 --- a/spec/processors/message_processor/me_spec.rb +++ b/spec/processors/message_processor/me_spec.rb @@ -17,25 +17,25 @@ it 'has message model trait' do text_starts_with = me.text.starts_with? '/me ' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do chat.disable! - expect(described_class.new(me).responds?).to eq false + expect(described_class.new(me).responds?).to be false end it 'non /me command' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end @@ -52,7 +52,7 @@ subject(:result) { described_class.new(me).process } it "don't replies, just answers" do - expect(result[:send_message][:reply_to_message_id]).to eq nil + expect(result[:send_message][:reply_to_message_id]).to be_nil end end diff --git a/spec/processors/message_processor/ping_spec.rb b/spec/processors/message_processor/ping_spec.rb index 4f337bf..4a98f22 100644 --- a/spec/processors/message_processor/ping_spec.rb +++ b/spec/processors/message_processor/ping_spec.rb @@ -15,25 +15,25 @@ it 'has message model trait' do text_starts_with = ping.text.starts_with? '/ping' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do chat.disable! - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'non /ping command' do - expect(described_class.new(me).responds?).to eq false + expect(described_class.new(me).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end diff --git a/spec/processors/message_processor/say_spec.rb b/spec/processors/message_processor/say_spec.rb index 64cf843..c4640e6 100644 --- a/spec/processors/message_processor/say_spec.rb +++ b/spec/processors/message_processor/say_spec.rb @@ -17,25 +17,25 @@ it 'has message model trait' do text_starts_with = say.text.starts_with? '/say ' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do chat.disable! - expect(described_class.new(say).responds?).to eq false + expect(described_class.new(say).responds?).to be false end it 'non /say command' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end @@ -43,7 +43,7 @@ subject(:result) { described_class.new(say).process } it 'just answers' do - expect(result[:send_message][:reply_to_message_id]).to eq nil + expect(result[:send_message][:reply_to_message_id]).to be_nil end end diff --git a/spec/processors/message_processor/start_spec.rb b/spec/processors/message_processor/start_spec.rb index 172566b..2659653 100644 --- a/spec/processors/message_processor/start_spec.rb +++ b/spec/processors/message_processor/start_spec.rb @@ -18,20 +18,20 @@ it 'has message model trait' do text_starts_with = owner_start.text.starts_with? '/start' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end diff --git a/spec/processors/message_processor/status_spec.rb b/spec/processors/message_processor/status_spec.rb index 2d39828..e7840a0 100644 --- a/spec/processors/message_processor/status_spec.rb +++ b/spec/processors/message_processor/status_spec.rb @@ -15,25 +15,25 @@ it 'has message model trait' do text_starts_with = status.text.starts_with? '/status' - expect(text_starts_with).to eq true + expect(text_starts_with).to be true end describe '#responds?' do it 'diasbled chat' do chat.disable! - expect(described_class.new(status).responds?).to eq false + expect(described_class.new(status).responds?).to be false end it 'non /status command' do - expect(described_class.new(me).responds?).to eq false + expect(described_class.new(me).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end end diff --git a/spec/processors/message_processor/stop_spec.rb b/spec/processors/message_processor/stop_spec.rb index d54f1fa..6b6c914 100644 --- a/spec/processors/message_processor/stop_spec.rb +++ b/spec/processors/message_processor/stop_spec.rb @@ -18,20 +18,20 @@ it 'has message model trait' do text_starts_with = owner_stop.text.starts_with? '/stop' - expect(text_starts_with).to eq true + expect(text_starts_with).to be_truthy end describe '#responds?' do it 'diasbled chat' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping)).not_to be_responds end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture)).not_to be_responds end it 'non command' do - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text)).not_to be_responds end end diff --git a/spec/processors/message_processor/text_spec.rb b/spec/processors/message_processor/text_spec.rb index ac76e23..5a8e956 100644 --- a/spec/processors/message_processor/text_spec.rb +++ b/spec/processors/message_processor/text_spec.rb @@ -18,19 +18,19 @@ it 'diasbled chat' do chat.disable! - expect(described_class.new(text).responds?).to eq false + expect(described_class.new(text).responds?).to be false end it 'command' do - expect(described_class.new(ping).responds?).to eq false + expect(described_class.new(ping).responds?).to be false end it 'empty text' do - expect(described_class.new(picture).responds?).to eq false + expect(described_class.new(picture).responds?).to be false end it 'text' do - expect(described_class.new(text).responds?).to eq true + expect(described_class.new(text).responds?).to be true end end diff --git a/spec/processors/message_processor/winner_spec.rb b/spec/processors/message_processor/winner_spec.rb index b6d1d3a..5d8803a 100644 --- a/spec/processors/message_processor/winner_spec.rb +++ b/spec/processors/message_processor/winner_spec.rb @@ -25,7 +25,7 @@ end it "doesn't repsond to text" do - expect(process_method).to eq nil + expect(process_method).to be_nil end end @@ -33,7 +33,7 @@ let(:chat) { create :chat, :disabled } it "doesn't repsond to command" do - expect(process_method).to eq nil + expect(process_method).to be_nil end it "doesn't process background tasks" do diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 80ef9ca..672e630 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -11,7 +11,7 @@ abort('The Rails environment is running in production mode!') if Rails.env.production? require 'rspec/rails' -Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } +Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } begin ActiveRecord::Migration.maintain_test_schema! @@ -21,7 +21,7 @@ end RSpec.configure do |config| - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_path = Rails.root.join('spec/fixtures').to_s config.use_transactional_fixtures = true config.infer_spec_type_from_file_location! config.filter_rails_from_backtrace!