chore: Fixes the missing gem warning (#3207)

* chore: Fixes the missing gem warning

fixes: #3143

* chore: rubocop fixes

Co-authored-by: Tejaswini Chile <tejaswini776@gmail.com>
This commit is contained in:
Sojan Jose 2021-10-14 13:57:01 +05:30 committed by GitHub
parent 590001cca2
commit 0c65db925d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 115 additions and 96 deletions

View file

@ -147,6 +147,11 @@ group :test do
end end
group :development, :test do group :development, :test do
# TODO: is this needed ?
# errors thrown by devise password gem
gem 'flay'
gem 'rspec'
# for error thrown by devise password gem
gem 'active_record_query_trace' gem 'active_record_query_trace'
gem 'bundle-audit', require: false gem 'bundle-audit', require: false
gem 'byebug', platform: :mri gem 'byebug', platform: :mri

View file

@ -90,21 +90,21 @@ GEM
rake (>= 10.4, < 14.0) rake (>= 10.4, < 14.0)
ast (2.4.2) ast (2.4.2)
attr_extras (6.2.4) attr_extras (6.2.4)
aws-eventstream (1.1.1) aws-eventstream (1.2.0)
aws-partitions (1.482.0) aws-partitions (1.513.0)
aws-sdk-core (3.119.0) aws-sdk-core (3.121.1)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0) aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-kms (1.46.0) aws-sdk-kms (1.49.0)
aws-sdk-core (~> 3, >= 3.119.0) aws-sdk-core (~> 3, >= 3.120.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.98.0) aws-sdk-s3 (1.103.0)
aws-sdk-core (~> 3, >= 3.119.0) aws-sdk-core (~> 3, >= 3.120.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.4)
aws-sigv4 (1.2.4) aws-sigv4 (1.4.0)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
azure-storage-blob (2.0.1) azure-storage-blob (2.0.1)
azure-storage-common (~> 2.0) azure-storage-common (~> 2.0)
@ -119,28 +119,28 @@ GEM
statsd-ruby (~> 1.1) statsd-ruby (~> 1.1)
bcrypt (3.1.16) bcrypt (3.1.16)
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.7.7) bootsnap (1.9.1)
msgpack (~> 1.0) msgpack (~> 1.0)
brakeman (5.1.1) brakeman (5.1.1)
browser (5.3.1) browser (5.3.1)
builder (3.2.4) builder (3.2.4)
bullet (6.1.4) bullet (6.1.5)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
uniform_notifier (~> 1.11) uniform_notifier (~> 1.11)
bundle-audit (0.1.0) bundle-audit (0.1.0)
bundler-audit bundler-audit
bundler-audit (0.8.0) bundler-audit (0.9.0.1)
bundler (>= 1.2.0, < 3) bundler (>= 1.2.0, < 3)
thor (~> 1.0) thor (~> 1.0)
byebug (11.1.3) byebug (11.1.3)
coderay (1.1.3) coderay (1.1.3)
commonmarker (0.22.0) commonmarker (0.23.2)
concurrent-ruby (1.1.9) concurrent-ruby (1.1.9)
connection_pool (2.2.5) connection_pool (2.2.5)
crack (0.4.5) crack (0.4.5)
rexml rexml
crass (1.0.6) crass (1.0.6)
cypress-on-rails (1.10.1) cypress-on-rails (1.11.0)
rack rack
database_cleaner (2.0.1) database_cleaner (2.0.1)
database_cleaner-active_record (~> 2.0.0) database_cleaner-active_record (~> 2.0.0)
@ -150,7 +150,7 @@ GEM
database_cleaner-core (2.0.1) database_cleaner-core (2.0.1)
datetime_picker_rails (0.0.7) datetime_picker_rails (0.0.7)
momentjs-rails (>= 2.8.1) momentjs-rails (>= 2.8.1)
ddtrace (0.51.1) ddtrace (0.53.0)
ffi (~> 1.0) ffi (~> 1.0)
msgpack msgpack
declarative (0.0.20) declarative (0.0.20)
@ -174,12 +174,13 @@ GEM
dotenv-rails (2.7.6) dotenv-rails (2.7.6)
dotenv (= 2.7.6) dotenv (= 2.7.6)
railties (>= 3.2) railties (>= 3.2)
down (5.2.3) down (5.2.4)
addressable (~> 2.8) addressable (~> 2.8)
ecma-re-validator (0.3.0) ecma-re-validator (0.3.0)
regexp_parser (~> 2.0) regexp_parser (~> 2.0)
erubi (1.10.0) erubi (1.10.0)
et-orbi (1.2.4) erubis (2.7.0)
et-orbi (1.2.5)
tzinfo tzinfo
execjs (2.8.1) execjs (2.8.1)
facebook-messenger (2.0.1) facebook-messenger (2.0.1)
@ -190,7 +191,7 @@ GEM
factory_bot_rails (6.2.0) factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0) factory_bot (~> 6.2.0)
railties (>= 5.0.0) railties (>= 5.0.0)
faker (2.18.0) faker (2.19.0)
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
faraday (1.0.1) faraday (1.0.1)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
@ -198,10 +199,15 @@ GEM
faraday (~> 1.0) faraday (~> 1.0)
fcm (1.0.3) fcm (1.0.3)
faraday (~> 1) faraday (~> 1)
ffi (1.15.3) ffi (1.15.4)
flag_shih_tzu (0.3.23) flag_shih_tzu (0.3.23)
flay (2.12.1)
erubis (~> 2.7.0)
path_expander (~> 1.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
foreman (0.87.2) foreman (0.87.2)
fugit (1.5.0) fugit (1.5.2)
et-orbi (~> 1.1, >= 1.1.8) et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.4) raabro (~> 1.4)
gapic-common (0.3.4) gapic-common (0.3.4)
@ -210,7 +216,7 @@ GEM
googleapis-common-protos-types (>= 1.0.4, < 2.0) googleapis-common-protos-types (>= 1.0.4, < 2.0)
googleauth (~> 0.9) googleauth (~> 0.9)
grpc (~> 1.25) grpc (~> 1.25)
geocoder (1.6.7) geocoder (1.7.0)
gli (2.20.1) gli (2.20.1)
globalid (0.5.2) globalid (0.5.2)
activesupport (>= 5.0) activesupport (>= 5.0)
@ -223,9 +229,9 @@ GEM
retriable (>= 2.0, < 4.a) retriable (>= 2.0, < 4.a)
rexml rexml
webrick webrick
google-apis-iamcredentials_v1 (0.6.0) google-apis-iamcredentials_v1 (0.7.0)
google-apis-core (>= 0.4, < 2.a) google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.6.0) google-apis-storage_v1 (0.8.0)
google-apis-core (>= 0.4, < 2.a) google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0) google-cloud-core (1.6.0)
google-cloud-env (~> 1.0) google-cloud-env (~> 1.0)
@ -238,7 +244,7 @@ GEM
google-cloud-errors (~> 1.0) google-cloud-errors (~> 1.0)
google-cloud-env (1.5.0) google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0) faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.1.0) google-cloud-errors (1.2.0)
google-cloud-storage (1.34.1) google-cloud-storage (1.34.1)
addressable (~> 2.5) addressable (~> 2.5)
digest-crc (~> 0.4) digest-crc (~> 0.4)
@ -247,32 +253,32 @@ GEM
google-cloud-core (~> 1.6) google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a) googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0) mini_mime (~> 1.0)
google-protobuf (3.17.3) google-protobuf (3.18.1)
google-protobuf (3.17.3-universal-darwin) google-protobuf (3.18.1-universal-darwin)
google-protobuf (3.17.3-x86_64-linux) google-protobuf (3.18.1-x86_64-linux)
googleapis-common-protos (1.3.11) googleapis-common-protos (1.3.12)
google-protobuf (~> 3.14) google-protobuf (~> 3.14)
googleapis-common-protos-types (>= 1.0.6, < 2.0) googleapis-common-protos-types (~> 1.2)
grpc (~> 1.27) grpc (~> 1.27)
googleapis-common-protos-types (1.1.0) googleapis-common-protos-types (1.2.0)
google-protobuf (~> 3.14) google-protobuf (~> 3.14)
googleauth (0.17.0) googleauth (0.17.1)
faraday (>= 0.17.3, < 2.0) faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0) jwt (>= 1.4, < 3.0)
memoist (~> 0.16) memoist (~> 0.16)
multi_json (~> 1.11) multi_json (~> 1.11)
os (>= 0.9, < 2.0) os (>= 0.9, < 2.0)
signet (~> 0.14) signet (~> 0.15)
groupdate (5.2.2) groupdate (5.2.2)
activesupport (>= 5) activesupport (>= 5)
grpc (1.38.0) grpc (1.41.0)
google-protobuf (~> 3.15) google-protobuf (~> 3.17)
googleapis-common-protos-types (~> 1.0) googleapis-common-protos-types (~> 1.0)
grpc (1.38.0-universal-darwin) grpc (1.41.0-universal-darwin)
google-protobuf (~> 3.15) google-protobuf (~> 3.17)
googleapis-common-protos-types (~> 1.0) googleapis-common-protos-types (~> 1.0)
grpc (1.38.0-x86_64-linux) grpc (1.41.0-x86_64-linux)
google-protobuf (~> 3.15) google-protobuf (~> 3.17)
googleapis-common-protos-types (~> 1.0) googleapis-common-protos-types (~> 1.0)
haikunator (1.1.1) haikunator (1.1.1)
hairtrigger (0.2.24) hairtrigger (0.2.24)
@ -286,7 +292,7 @@ GEM
http-accept (1.7.0) http-accept (1.7.0)
http-cookie (1.0.4) http-cookie (1.0.4)
domain_name (~> 0.5) domain_name (~> 0.5)
httparty (0.18.1) httparty (0.20.0)
mime-types (~> 3.0) mime-types (~> 3.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
httpclient (2.8.3) httpclient (2.8.3)
@ -310,7 +316,7 @@ GEM
hana (~> 1.3) hana (~> 1.3)
regexp_parser (~> 2.0) regexp_parser (~> 2.0)
uri_template (~> 0.7) uri_template (~> 0.7)
jwt (2.2.3) jwt (2.3.0)
kaminari (1.2.1) kaminari (1.2.1)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.1) kaminari-actionview (= 1.2.1)
@ -331,9 +337,9 @@ GEM
addressable (~> 2.7) addressable (~> 2.7)
letter_opener (1.7.0) letter_opener (1.7.0)
launchy (~> 2.2) launchy (~> 2.2)
line-bot-api (1.21.0) line-bot-api (1.22.0)
liquid (5.0.1) liquid (5.1.0)
listen (3.6.0) listen (3.7.0)
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.12.0) loofah (2.12.0)
@ -341,18 +347,18 @@ GEM
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
mail (2.7.1) mail (2.7.1)
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
marcel (1.0.1) marcel (1.0.2)
maxminddb (0.1.22) maxminddb (0.1.22)
memoist (0.16.2) memoist (0.16.2)
method_source (1.0.0) method_source (1.0.0)
mime-types (3.3.1) mime-types (3.3.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
mime-types-data (3.2021.0704) mime-types-data (3.2021.0901)
mini_magick (4.11.0) mini_magick (4.11.0)
mini_mime (1.1.1) mini_mime (1.1.2)
mini_portile2 (2.5.3) mini_portile2 (2.5.3)
minitest (5.14.4) minitest (5.14.4)
mock_redis (0.28.0) mock_redis (0.29.0)
ruby2_keywords ruby2_keywords
momentjs-rails (2.20.1) momentjs-rails (2.20.1)
railties (>= 3.1) railties (>= 3.1)
@ -363,7 +369,7 @@ GEM
net-http-persistent (4.0.1) net-http-persistent (4.0.1)
connection_pool (~> 2.2) connection_pool (~> 2.2)
netrc (0.11.0) netrc (0.11.0)
newrelic_rpm (7.2.0) newrelic_rpm (8.0.0)
nio4r (2.5.8) nio4r (2.5.8)
nokogiri (1.11.7) nokogiri (1.11.7)
mini_portile2 (~> 2.5.0) mini_portile2 (~> 2.5.0)
@ -377,9 +383,10 @@ GEM
oauth (0.5.6) oauth (0.5.6)
orm_adapter (0.5.0) orm_adapter (0.5.0)
os (1.1.1) os (1.1.1)
parallel (1.20.1) parallel (1.21.0)
parser (3.0.2.0) parser (3.0.2.0)
ast (~> 2.4.1) ast (~> 2.4.1)
path_expander (1.1.0)
pg (1.2.3) pg (1.2.3)
procore-sift (0.16.0) procore-sift (0.16.0)
rails (> 4.2.0) rails (> 4.2.0)
@ -391,7 +398,7 @@ GEM
public_suffix (4.0.6) public_suffix (4.0.6)
puma (5.5.1) puma (5.5.1)
nio4r (~> 2.0) nio4r (~> 2.0)
pundit (2.1.0) pundit (2.1.1)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
raabro (1.4.0) raabro (1.4.0)
racc (1.5.2) racc (1.5.2)
@ -423,7 +430,7 @@ GEM
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.4.1) rails-html-sanitizer (1.4.2)
loofah (~> 2.3) loofah (~> 2.3)
railties (6.1.4.1) railties (6.1.4.1)
actionpack (= 6.1.4.1) actionpack (= 6.1.4.1)
@ -454,6 +461,10 @@ GEM
netrc (~> 0.8) netrc (~> 0.8)
retriable (3.1.2) retriable (3.1.2)
rexml (3.2.5) rexml (3.2.5)
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-core (3.10.1)
rspec-support (~> 3.10.0) rspec-support (~> 3.10.0)
rspec-expectations (3.10.1) rspec-expectations (3.10.1)
@ -462,7 +473,7 @@ GEM
rspec-mocks (3.10.2) rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0) rspec-support (~> 3.10.0)
rspec-rails (5.0.1) rspec-rails (5.0.2)
actionpack (>= 5.2) actionpack (>= 5.2)
activesupport (>= 5.2) activesupport (>= 5.2)
railties (>= 5.2) railties (>= 5.2)
@ -471,35 +482,34 @@ GEM
rspec-mocks (~> 3.10) rspec-mocks (~> 3.10)
rspec-support (~> 3.10) rspec-support (~> 3.10)
rspec-support (3.10.2) rspec-support (3.10.2)
rubocop (1.18.4) rubocop (1.22.1)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.0.0.0) parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0) regexp_parser (>= 1.8, < 3.0)
rexml rexml
rubocop-ast (>= 1.8.0, < 2.0) rubocop-ast (>= 1.12.0, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0) unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.8.0) rubocop-ast (1.12.0)
parser (>= 3.0.1.1) parser (>= 3.0.1.1)
rubocop-performance (1.11.4) rubocop-performance (1.11.5)
rubocop (>= 1.7.0, < 2.0) rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0) rubocop-ast (>= 0.4.0)
rubocop-rails (2.11.3) rubocop-rails (2.12.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0) rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (2.4.0) rubocop-rspec (2.5.0)
rubocop (~> 1.0) rubocop (~> 1.19)
rubocop-ast (>= 1.1.0)
ruby-progressbar (1.11.0) ruby-progressbar (1.11.0)
ruby-vips (2.1.2) ruby-vips (2.1.3)
ffi (~> 1.12) ffi (~> 1.12)
ruby2_keywords (0.0.5) ruby2_keywords (0.0.5)
ruby2ruby (2.4.4) ruby2ruby (2.4.4)
ruby_parser (~> 3.1) ruby_parser (~> 3.1)
sexp_processor (~> 4.6) sexp_processor (~> 4.6)
ruby_parser (3.16.0) ruby_parser (3.17.0)
sexp_processor (~> 4.15, >= 4.15.1) sexp_processor (~> 4.15, >= 4.15.1)
sassc (2.4.0) sassc (2.4.0)
ffi (~> 1.9) ffi (~> 1.9)
@ -509,38 +519,38 @@ GEM
sprockets (> 3.0) sprockets (> 3.0)
sprockets-rails sprockets-rails
tilt tilt
scout_apm (4.1.1) scout_apm (4.1.2)
parser parser
seed_dump (3.3.1) seed_dump (3.3.1)
activerecord (>= 4) activerecord (>= 4)
activesupport (>= 4) activesupport (>= 4)
selectize-rails (0.12.6) selectize-rails (0.12.6)
semantic_range (3.0.0) semantic_range (3.0.0)
sentry-rails (4.6.4) sentry-rails (4.7.3)
railties (>= 5.0) railties (>= 5.0)
sentry-ruby-core (~> 4.6.0) sentry-ruby-core (~> 4.7.0)
sentry-ruby (4.6.4) sentry-ruby (4.7.3)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
faraday (>= 1.0) faraday (>= 1.0)
sentry-ruby-core (= 4.6.4) sentry-ruby-core (= 4.7.3)
sentry-ruby-core (4.6.4) sentry-ruby-core (4.7.3)
concurrent-ruby concurrent-ruby
faraday faraday
sentry-sidekiq (4.6.4) sentry-sidekiq (4.7.3)
sentry-ruby-core (~> 4.6.0) sentry-ruby-core (~> 4.7.0)
sidekiq (>= 3.0) sidekiq (>= 3.0)
sexp_processor (4.15.3) sexp_processor (4.15.3)
shoulda-matchers (5.0.0) shoulda-matchers (5.0.0)
activesupport (>= 5.2.0) activesupport (>= 5.2.0)
sidekiq (6.2.1) sidekiq (6.2.2)
connection_pool (>= 2.2.2) connection_pool (>= 2.2.2)
rack (~> 2.0) rack (~> 2.0)
redis (>= 4.2.0) redis (>= 4.2.0)
sidekiq-cron (1.2.0) sidekiq-cron (1.2.0)
fugit (~> 1.1) fugit (~> 1.1)
sidekiq (>= 4.2.1) sidekiq (>= 4.2.1)
signet (0.15.0) signet (0.16.0)
addressable (~> 2.3) addressable (~> 2.8)
faraday (>= 0.17.3, < 2.0) faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0) jwt (>= 1.5, < 3.0)
multi_json (~> 1.10) multi_json (~> 1.10)
@ -583,15 +593,15 @@ GEM
oauth oauth
tzinfo (2.0.4) tzinfo (2.0.4)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
tzinfo-data (1.2021.1) tzinfo-data (1.2021.3)
tzinfo (>= 1.0.0) tzinfo (>= 1.0.0)
uber (0.1.0) uber (0.1.0)
uglifier (4.2.0) uglifier (4.2.0)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.7) unf_ext (0.0.8)
unicode-display_width (2.0.0) unicode-display_width (2.1.0)
uniform_notifier (1.14.2) uniform_notifier (1.14.2)
uri_template (0.7.0) uri_template (0.7.0)
valid_email2 (4.0.0) valid_email2 (4.0.0)
@ -604,11 +614,11 @@ GEM
activemodel (>= 6.0.0) activemodel (>= 6.0.0)
bindex (>= 0.4.0) bindex (>= 0.4.0)
railties (>= 6.0.0) railties (>= 6.0.0)
webmock (3.13.0) webmock (3.14.0)
addressable (>= 2.3.6) addressable (>= 2.8.0)
crack (>= 0.3.2) crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0) hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.0) webpacker (5.4.3)
activesupport (>= 5.2) activesupport (>= 5.2)
rack-proxy (>= 0.6.1) rack-proxy (>= 0.6.1)
railties (>= 5.2) railties (>= 5.2)
@ -661,6 +671,7 @@ DEPENDENCIES
faker faker
fcm fcm
flag_shih_tzu flag_shih_tzu
flay
foreman foreman
geocoder geocoder
google-cloud-dialogflow google-cloud-dialogflow
@ -696,6 +707,7 @@ DEPENDENCIES
redis-namespace redis-namespace
responders responders
rest-client rest-client
rspec
rspec-rails (~> 5.0.0) rspec-rails (~> 5.0.0)
rubocop rubocop
rubocop-performance rubocop-performance

View file

@ -2,7 +2,7 @@ class RemoveNotificationsWithoutPrimaryActor < ActiveRecord::Migration[6.0]
def change def change
deleted_ids = [] deleted_ids = []
Notification.where(primary_actor_type: 'Conversation').pluck(:primary_actor_id).uniq.each_slice(1000) do |id_list| Notification.where(primary_actor_type: 'Conversation').pluck(:primary_actor_id).uniq.each_slice(1000) do |id_list|
deleted_ids << id_list - Conversation.where(id: id_list).pluck(:id) deleted_ids << (id_list - Conversation.where(id: id_list).pluck(:id))
end end
Notification.where(primary_actor_type: 'Conversation', primary_actor_id: deleted_ids).destroy_all Notification.where(primary_actor_type: 'Conversation', primary_actor_id: deleted_ids).destroy_all
end end

View file

@ -54,7 +54,7 @@ RSpec.describe 'Installation::Onboarding API', type: :request do
end end
context 'when onboarding is not successfull' do context 'when onboarding is not successfull' do
it ' does not deletes the redis key' do it 'does not deletes the redis key' do
allow(AccountBuilder).to receive(:new).and_raise('error') allow(AccountBuilder).to receive(:new).and_raise('error')
post '/installation/onboarding', params: { user: {} } post '/installation/onboarding', params: { user: {} }
expect(::Redis::Alfred.get(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)).not_to eq nil expect(::Redis::Alfred.get(::Redis::Alfred::CHATWOOT_INSTALLATION_ONBOARDING)).not_to eq nil

View file

@ -21,7 +21,7 @@ RSpec.describe TriggerScheduledItemsJob, type: :job do
described_class.perform_now described_class.perform_now
end end
it 'triggers Conversations::ReopenSnoozedConversationsJob' do it 'triggers Conversations::ReopenSnoozedConversationsJob' do
expect(Conversations::ReopenSnoozedConversationsJob).to receive(:perform_later).once expect(Conversations::ReopenSnoozedConversationsJob).to receive(:perform_later).once
described_class.perform_now described_class.perform_now
end end

View file

@ -56,7 +56,7 @@ describe ::EmailTemplates::DbResolverService do
Current.account = nil Current.account = nil
end end
it 'return installation template when current account dont have template' do it 'return installation template when current account dont have template' do
Current.account = create(:account) Current.account = create(:account)
handler = ActionView::Template.registered_template_handler(:liquid) handler = ActionView::Template.registered_template_handler(:liquid)
template_details = { template_details = {

View file

@ -1,41 +1,43 @@
require 'rails_helper' require 'rails_helper'
describe RoundRobin::ManageService do describe RoundRobin::ManageService do
subject(:round_robin_manage_service) { ::RoundRobin::ManageService.new(inbox: inbox) }
let!(:account) { create(:account) } let!(:account) { create(:account) }
let!(:inbox) { create(:inbox, account: account) } let!(:inbox) { create(:inbox, account: account) }
let!(:inbox_members) { create_list(:inbox_member, 5, inbox: inbox) } let!(:inbox_members) { create_list(:inbox_member, 5, inbox: inbox) }
let(:subject) { ::RoundRobin::ManageService.new(inbox: inbox) }
describe '#available_agent' do describe '#available_agent' do
it 'gets the first available agent and move agent to end of the list' do it 'gets the first available agent and move agent to end of the list' do
expected_queue = [inbox_members[0].user_id, inbox_members[4].user_id, inbox_members[3].user_id, inbox_members[2].user_id, expected_queue = [inbox_members[0].user_id, inbox_members[4].user_id, inbox_members[3].user_id, inbox_members[2].user_id,
inbox_members[1].user_id].map(&:to_s) inbox_members[1].user_id].map(&:to_s)
subject.available_agent round_robin_manage_service.available_agent
expect(subject.send(:queue)).to eq(expected_queue) expect(round_robin_manage_service.send(:queue)).to eq(expected_queue)
end end
it 'gets intersection of priority list and agent queue. get and move agent to the end of the list' do it 'gets intersection of priority list and agent queue. get and move agent to the end of the list' do
expected_queue = [inbox_members[2].user_id, inbox_members[4].user_id, inbox_members[3].user_id, inbox_members[1].user_id, expected_queue = [inbox_members[2].user_id, inbox_members[4].user_id, inbox_members[3].user_id, inbox_members[1].user_id,
inbox_members[0].user_id].map(&:to_s) inbox_members[0].user_id].map(&:to_s)
expect(subject.available_agent(priority_list: [inbox_members[3].user_id, inbox_members[2].user_id])).to eq inbox_members[2].user expect(round_robin_manage_service.available_agent(priority_list: [inbox_members[3].user_id,
expect(subject.send(:queue)).to eq(expected_queue) inbox_members[2].user_id])).to eq inbox_members[2].user
expect(round_robin_manage_service.send(:queue)).to eq(expected_queue)
end end
it 'constructs round_robin_queue if queue is not present' do it 'constructs round_robin_queue if queue is not present' do
subject.clear_queue round_robin_manage_service.clear_queue
expect(subject.send(:queue)).to eq([]) expect(round_robin_manage_service.send(:queue)).to eq([])
subject.available_agent round_robin_manage_service.available_agent
# the service constructed the redis queue before performing # the service constructed the redis queue before performing
expect(subject.send(:queue).sort.map(&:to_i)).to eq(inbox_members.map(&:user_id).sort) expect(round_robin_manage_service.send(:queue).sort.map(&:to_i)).to eq(inbox_members.map(&:user_id).sort)
end end
it 'validates the queue and correct it before performing round robin' do it 'validates the queue and correct it before performing round robin' do
# adding some invalid ids to queue # adding some invalid ids to queue
subject.add_agent_to_queue([2, 3, 5, 9]) round_robin_manage_service.add_agent_to_queue([2, 3, 5, 9])
expect(subject.send(:queue).sort.map(&:to_i)).not_to eq(inbox_members.map(&:user_id).sort) expect(round_robin_manage_service.send(:queue).sort.map(&:to_i)).not_to eq(inbox_members.map(&:user_id).sort)
subject.available_agent round_robin_manage_service.available_agent
# the service have refreshed the redis queue before performing # the service have refreshed the redis queue before performing
expect(subject.send(:queue).sort.map(&:to_i)).to eq(inbox_members.map(&:user_id).sort) expect(round_robin_manage_service.send(:queue).sort.map(&:to_i)).to eq(inbox_members.map(&:user_id).sort)
end end
end end
end end