Update Rails to 6.1.1, ruby to 2.7.2 [SCI-5459]

This commit is contained in:
Oleksii Kriuchykhin 2021-01-28 14:43:45 +01:00
parent 5be99307e4
commit 75da67b937
29 changed files with 477 additions and 479 deletions

View file

@ -1,4 +1,4 @@
FROM ruby:2.6.4-buster
FROM ruby:2.7.2-buster
MAINTAINER BioSistemika <info@biosistemika.com>
ARG WKHTMLTOPDF_PACKAGE_URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb

View file

@ -1,4 +1,4 @@
FROM ruby:2.6.4-buster
FROM ruby:2.7.2-buster
MAINTAINER BioSistemika <info@biosistemika.com>
ARG WKHTMLTOPDF_PACKAGE_URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb

View file

@ -2,7 +2,7 @@
source 'http://rubygems.org'
ruby '2.6.4'
ruby '2.7.2'
gem 'bootsnap', require: false
gem 'bootstrap-sass', '~> 3.4.1'
@ -12,7 +12,7 @@ gem 'devise_invitable'
gem 'figaro'
gem 'pg', '~> 1.1'
gem 'pg_search' # PostgreSQL full text search
gem 'rails', '~> 6.0.0'
gem 'rails', '~> 6.1.1'
gem 'recaptcha', require: 'recaptcha/rails'
gem 'sanitize', '~> 5.2'
gem 'sassc-rails'
@ -66,7 +66,7 @@ gem 'deface', '~> 1.0'
gem 'down', '~> 5.0'
gem 'faker' # Generate fake data
gem 'fastimage' # Light gem to get image resolution
gem 'httparty', '~> 0.13.1'
gem 'httparty', '~> 0.17.3'
gem 'i18n-js', '~> 3.6' # Localization in javascript files
gem 'jbuilder' # JSON structures via a Builder-style DSL
gem 'logging', '~> 2.0.0'

View file

@ -17,7 +17,7 @@ GIT
GIT
remote: https://github.com/biosistemika/yomu
revision: 063b855d672e9dd9de1e6e585b349a9b63e120c3
revision: 3baa161e76b433ede55142dd1bb7cc04159f93f0
branch: master
specs:
yomu (0.2.4)
@ -42,115 +42,134 @@ GIT
GEM
remote: http://rubygems.org/
specs:
actioncable (6.0.3)
actionpack (= 6.0.3)
actioncable (6.1.1)
actionpack (= 6.1.1)
activesupport (= 6.1.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.3)
actionpack (= 6.0.3)
activejob (= 6.0.3)
activerecord (= 6.0.3)
activestorage (= 6.0.3)
activesupport (= 6.0.3)
actionmailbox (6.1.1)
actionpack (= 6.1.1)
activejob (= 6.1.1)
activerecord (= 6.1.1)
activestorage (= 6.1.1)
activesupport (= 6.1.1)
mail (>= 2.7.1)
actionmailer (6.0.3)
actionpack (= 6.0.3)
actionview (= 6.0.3)
activejob (= 6.0.3)
actionmailer (6.1.1)
actionpack (= 6.1.1)
actionview (= 6.1.1)
activejob (= 6.1.1)
activesupport (= 6.1.1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.3)
actionview (= 6.0.3)
activesupport (= 6.0.3)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.1)
actionview (= 6.1.1)
activesupport (= 6.1.1)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.3)
actionpack (= 6.0.3)
activerecord (= 6.0.3)
activestorage (= 6.0.3)
activesupport (= 6.0.3)
actiontext (6.1.1)
actionpack (= 6.1.1)
activerecord (= 6.1.1)
activestorage (= 6.1.1)
activesupport (= 6.1.1)
nokogiri (>= 1.8.5)
actionview (6.0.3)
activesupport (= 6.0.3)
actionview (6.1.1)
activesupport (= 6.1.1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
active_model_serializers (0.10.10)
actionpack (>= 4.1, < 6.1)
activemodel (>= 4.1, < 6.1)
active_model_serializers (0.10.12)
actionpack (>= 4.1, < 6.2)
activemodel (>= 4.1, < 6.2)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (6.0.3)
activesupport (= 6.0.3)
activejob (6.1.1)
activesupport (= 6.1.1)
globalid (>= 0.3.6)
activemodel (6.0.3)
activesupport (= 6.0.3)
activerecord (6.0.3)
activemodel (= 6.0.3)
activesupport (= 6.0.3)
activerecord-import (1.0.4)
activemodel (6.1.1)
activesupport (= 6.1.1)
activerecord (6.1.1)
activemodel (= 6.1.1)
activesupport (= 6.1.1)
activerecord-import (1.0.7)
activerecord (>= 3.2)
activestorage (6.0.3)
actionpack (= 6.0.3)
activejob (= 6.0.3)
activerecord (= 6.0.3)
activestorage (6.1.1)
actionpack (= 6.1.1)
activejob (= 6.1.1)
activerecord (= 6.1.1)
activesupport (= 6.1.1)
marcel (~> 0.3.1)
activesupport (6.0.3)
mimemagic (~> 0.3.2)
activesupport (6.1.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
aes_key_wrap (1.0.1)
aes_key_wrap (1.1.0)
ajax-datatables-rails (0.3.1)
railties (>= 3.1)
aspector (0.14.0)
ast (2.4.1)
auto_strip_attributes (2.5.0)
ast (2.4.2)
auto_strip_attributes (2.6.0)
activerecord (>= 4.0)
autoprefixer-rails (9.7.0)
autoprefixer-rails (10.2.0.0)
execjs
autosize-rails (1.18.17)
rails (>= 3.1)
awesome_print (1.8.0)
aws-eventstream (1.0.3)
aws-partitions (1.211.0)
aws-sdk-core (3.67.0)
aws-eventstream (~> 1.0, >= 1.0.2)
aws-partitions (~> 1.0)
aws-eventstream (1.1.0)
aws-partitions (1.420.0)
aws-record (2.5.0)
aws-sdk-dynamodb (~> 1.18)
aws-sdk-core (3.111.2)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.24.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sdk-dynamodb (1.58.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-rails (2.1.0)
aws-sdk-kms (1.41.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sdk-rails (3.6.0)
aws-record (~> 2)
aws-sdk-ses (~> 1)
railties (>= 3)
aws-sdk-s3 (1.48.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sdk-sqs (~> 1)
aws-sessionstore-dynamodb (~> 2)
concurrent-ruby (~> 1)
railties (>= 5.2.0)
aws-sdk-s3 (1.87.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sdk-ses (1.25.0)
aws-sdk-core (~> 3, >= 3.61.1)
aws-sdk-ses (1.36.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.1.0)
aws-eventstream (~> 1.0, >= 1.0.2)
backports (3.15.0)
aws-sdk-sqs (1.35.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sigv4 (~> 1.1)
aws-sessionstore-dynamodb (2.0.1)
aws-sdk-dynamodb (~> 1)
rack (~> 2)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1, >= 1.0.2)
backports (3.20.2)
base62 (1.0.0)
bcrypt (3.1.13)
better_errors (2.5.1)
bcrypt (3.1.16)
better_errors (2.9.1)
coderay (>= 1.0.0)
erubi (>= 1.0.0)
rack (>= 0.9.0)
bindata (2.4.4)
binding_of_caller (0.8.0)
bindata (2.4.8)
binding_of_caller (1.0.0)
debug_inspector (>= 0.0.1)
bootsnap (1.4.5)
bootsnap (1.6.0)
msgpack (~> 1.0)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
@ -160,34 +179,33 @@ GEM
momentjs-rails (>= 2.8.1)
bootstrap_form (2.7.0)
builder (3.2.4)
bullet (6.0.2)
bullet (6.1.3)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.0.1)
capybara (3.29.0)
byebug (11.1.3)
capybara (3.35.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
capybara-email (3.0.1)
capybara-email (3.0.2)
capybara (>= 2.4, < 4.0)
mail
caracal (1.4.1)
nokogiri (~> 1.6)
rubyzip (~> 1.1)
tilt (>= 1.4)
caracal-rails (1.0.1)
caracal-rails (1.0.2)
caracal (~> 1.0)
rails (>= 3.2)
case_transform (0.2)
activesupport
childprocess (1.0.1)
rake (< 13.0)
chunky_png (1.3.11)
coderay (1.1.2)
childprocess (3.0.0)
chunky_png (1.4.0)
coderay (1.1.3)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
railties (>= 5.2.0)
@ -195,11 +213,11 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.6)
crack (0.4.3)
safe_yaml (~> 1.0.0)
concurrent-ruby (1.1.8)
crack (0.4.5)
rexml
crass (1.0.6)
cucumber (3.1.2)
cucumber (3.2.0)
builder (>= 2.1.2)
cucumber-core (~> 3.2.0)
cucumber-expressions (~> 6.0.1)
@ -221,76 +239,80 @@ GEM
railties (>= 4.2, < 7)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.7.0)
debug_inspector (0.0.3)
deface (1.5.1)
database_cleaner (1.8.5)
debug_inspector (1.0.0)
deface (1.6.1)
nokogiri (>= 1.6)
polyglot
rails (>= 4.1)
rails (>= 5.2)
rainbow (>= 2.1.0)
delayed_job (4.1.8)
activesupport (>= 3.0, < 6.1)
delayed_job_active_record (4.1.4)
activerecord (>= 3.0, < 6.1)
delayed_job (4.1.9)
activesupport (>= 3.0, < 6.2)
delayed_job_active_record (4.1.5)
activerecord (>= 3.0, < 6.2)
delayed_job (>= 3.0, < 5)
devise (4.7.1)
devise (4.7.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
devise_invitable (2.0.1)
devise_invitable (2.0.3)
actionmailer (>= 5.0)
devise (>= 4.6)
diff-lcs (1.3)
discard (1.1.0)
diff-lcs (1.4.4)
discard (1.2.0)
activerecord (>= 4.2, < 7)
docile (1.3.2)
doorkeeper (5.1.1)
docile (1.3.5)
doorkeeper (5.4.0)
railties (>= 5)
down (5.0.0)
down (5.2.0)
addressable (~> 2.5)
erubi (1.9.0)
et-orbi (1.2.2)
erubi (1.10.0)
et-orbi (1.2.4)
tzinfo
execjs (2.7.0)
factory_bot (5.0.2)
activesupport (>= 4.2.0)
factory_bot_rails (5.0.2)
factory_bot (~> 5.0.2)
railties (>= 4.2.0)
faker (2.2.2)
i18n (~> 1.6.0)
faraday (0.15.4)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.1.0)
factory_bot (~> 6.1.0)
railties (>= 5.0.0)
faker (2.15.1)
i18n (>= 1.6, < 2)
faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3)
fastimage (2.1.7)
ffi (1.11.1)
figaro (1.1.1)
thor (~> 0.14)
fugit (1.3.3)
ruby2_keywords
faraday-net_http (1.0.1)
fastimage (2.2.1)
ffi (1.14.2)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
fugit (1.4.2)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.1)
raabro (~> 1.4)
generator (0.0.1)
gherkin (5.1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
hammerjs-rails (2.0.8)
hashdiff (1.0.0)
hashie (3.6.0)
httparty (0.13.7)
json (~> 1.8)
hashdiff (1.0.1)
hashie (4.1.0)
httparty (0.17.3)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.6.0)
i18n (1.8.7)
concurrent-ruby (~> 1.0)
i18n-js (3.6.0)
i18n-js (3.8.0)
i18n (>= 0.6.6)
image_processing (1.9.3)
image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.13, < 3)
iniparse (1.4.4)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
ruby-vips (>= 2.0.17, < 3)
iniparse (1.5.0)
jbuilder (2.11.2)
activesupport (>= 5.0.0)
jmespath (1.4.0)
jquery-rails (4.3.5)
jquery-rails (4.4.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
@ -298,14 +320,14 @@ GEM
railties (>= 3.2.16)
js_cookie_rails (2.2.0)
railties (>= 3.1)
json (1.8.6)
json-jwt (1.11.0)
json (2.5.1)
json-jwt (1.13.0)
activesupport (>= 4.2)
aes_key_wrap
bindata
json_matchers (0.11.1)
json_schema
json_schema (0.20.7)
json_schema (0.20.9)
jsonapi-renderer (0.2.2)
jwt (1.5.6)
kaminari (1.2.1)
@ -321,95 +343,94 @@ GEM
kaminari-core (= 1.2.1)
kaminari-core (1.2.1)
lazy_priority_queue (0.1.1)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
listen (3.4.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
little-plugger (1.1.4)
logging (2.0.0)
little-plugger (~> 1.1)
multi_json (~> 1.10)
loofah (2.5.0)
loofah (2.9.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
method_source (1.0.0)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2020.0512)
mime-types-data (3.2020.1104)
mimemagic (0.3.5)
mini_magick (4.9.5)
mini_magick (4.11.0)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.1)
minitest (5.14.3)
momentjs-rails (2.17.1)
railties (>= 3.1)
msgpack (1.3.1)
multi_json (1.13.1)
msgpack (1.4.1)
multi_json (1.15.0)
multi_test (0.1.2)
multi_xml (0.6.0)
multipart-post (2.1.1)
nested_form_fields (0.8.2)
nested_form_fields (0.8.4)
coffee-rails (>= 3.2.1)
jquery-rails
rails (>= 3.2.0)
newrelic_rpm (6.6.0.358)
nio4r (2.5.2)
nokogiri (1.11.0)
newrelic_rpm (6.15.0)
nio4r (2.5.4)
nokogiri (1.11.1)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
nokogumbo (2.0.2)
nokogumbo (2.0.4)
nokogiri (~> 1.8, >= 1.8.4)
oauth2 (1.4.1)
faraday (>= 0.8, < 0.16.0)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.9.0)
hashie (>= 3.4.6, < 3.7.0)
omniauth (1.9.1)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
omniauth-azure-activedirectory (1.0.0)
jwt (~> 1.5)
omniauth (~> 1.1)
omniauth-linkedin-oauth2 (1.0.0)
omniauth-oauth2
omniauth-oauth2 (1.6.0)
oauth2 (~> 1.1)
omniauth (~> 1.9)
omniauth-oauth2 (1.7.1)
oauth2 (~> 1.4)
omniauth (>= 1.9, < 3)
omniauth-rails_csrf_protection (0.1.2)
actionpack (>= 4.2)
omniauth (>= 1.3.1)
orm_adapter (0.5.0)
overcommit (0.49.1)
childprocess (>= 0.6.3, < 2.0)
overcommit (0.57.0)
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
parallel (1.19.2)
parser (2.7.1.4)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
pg (1.1.4)
pg_search (2.3.0)
activerecord (>= 4.2)
activesupport (>= 4.2)
pg (1.2.3)
pg_search (2.3.5)
activerecord (>= 5.2)
activesupport (>= 5.2)
polyglot (0.3.5)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.7.0)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.10)
pry (~> 0.13.0)
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.1)
puma (4.3.5)
public_suffix (4.0.6)
puma (5.2.0)
nio4r (~> 2.0)
raabro (1.1.6)
raabro (1.4.0)
racc (1.5.2)
rack (2.2.3)
rack-attack (6.1.0)
rack-attack (6.4.0)
rack (>= 1.0, < 3)
rack-cors (1.1.1)
rack (>= 2.0.0)
@ -417,25 +438,25 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3)
actioncable (= 6.0.3)
actionmailbox (= 6.0.3)
actionmailer (= 6.0.3)
actionpack (= 6.0.3)
actiontext (= 6.0.3)
actionview (= 6.0.3)
activejob (= 6.0.3)
activemodel (= 6.0.3)
activerecord (= 6.0.3)
activestorage (= 6.0.3)
activesupport (= 6.0.3)
bundler (>= 1.3.0)
railties (= 6.0.3)
rails (6.1.1)
actioncable (= 6.1.1)
actionmailbox (= 6.1.1)
actionmailer (= 6.1.1)
actionpack (= 6.1.1)
actiontext (= 6.1.1)
actionview (= 6.1.1)
activejob (= 6.1.1)
activemodel (= 6.1.1)
activerecord (= 6.1.1)
activestorage (= 6.1.1)
activesupport (= 6.1.1)
bundler (>= 1.15.0)
railties (= 6.1.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
actionview (>= 5.0.1.x)
activesupport (>= 5.0.1.x)
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)
nokogiri (>= 1.6)
@ -448,54 +469,53 @@ GEM
rails (> 3.1)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (6.0.3)
actionpack (= 6.0.3)
activesupport (= 6.0.3)
railties (6.1.1)
actionpack (= 6.1.1)
activesupport (= 6.1.1)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
thor (~> 1.0)
rainbow (3.0.0)
rake (12.3.3)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rake (13.0.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.2.0)
recaptcha (5.1.0)
rdoc (6.3.0)
recaptcha (5.6.0)
json
regexp_parser (1.6.0)
responders (3.0.0)
regexp_parser (2.0.3)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rgl (0.5.6)
rgl (0.5.7)
lazy_priority_queue (~> 0.1.0)
stream (~> 0.5.2)
roo (2.8.2)
stream (~> 0.5.3)
roo (2.8.3)
nokogiri (~> 1)
rubyzip (>= 1.2.1, < 2.0.0)
rotp (6.0.0)
addressable (~> 2.7)
rqrcode (1.1.2)
rubyzip (>= 1.3.0, < 3.0.0)
rotp (6.2.0)
rqrcode (1.2.0)
chunky_png (~> 1.0)
rqrcode_core (~> 0.1)
rqrcode_core (0.1.2)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
rqrcode_core (~> 0.2)
rqrcode_core (0.2.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.1)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (4.0.0.beta2)
rspec-support (~> 3.10.0)
rspec-rails (4.0.2)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-core (~> 3.8)
rspec-expectations (~> 3.8)
rspec-mocks (~> 3.8)
rspec-support (~> 3.8)
rspec-support (3.8.2)
rspec-core (~> 3.10)
rspec-expectations (~> 3.10)
rspec-mocks (~> 3.10)
rspec-support (~> 3.10)
rspec-support (3.10.1)
rubocop (0.83.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
@ -503,25 +523,26 @@ GEM
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-performance (1.5.1)
rubocop (>= 0.71.0)
rubocop-rails (2.4.0)
rubocop-performance (1.7.1)
rubocop (>= 0.82.0)
rubocop-rails (2.6.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.72.0)
ruby-graphviz (1.2.4)
ruby-progressbar (1.10.1)
ruby-vips (2.0.15)
rubocop (>= 0.82.0)
ruby-graphviz (1.2.5)
rexml
ruby-progressbar (1.11.0)
ruby-vips (2.0.17)
ffi (~> 1.9)
ruby_dep (1.5.0)
ruby2_keywords (0.0.4)
rubyzip (1.3.0)
rufus-scheduler (3.6.0)
rufus-scheduler (3.7.0)
fugit (~> 1.1, >= 1.1.6)
safe_yaml (1.0.5)
sanitize (5.2.1)
sanitize (5.2.3)
crass (~> 1.0.2)
nokogiri (>= 1.8.0)
nokogumbo (~> 2.0)
sassc (2.2.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
@ -529,55 +550,56 @@ GEM
sprockets (> 3.0)
sprockets-rails
tilt
scenic (1.5.1)
scenic (1.5.4)
activerecord (>= 4.0.0)
railties (>= 4.0.0)
sdoc (1.0.0)
sdoc (1.1.0)
rdoc (>= 5.0)
selenium-webdriver (3.142.4)
childprocess (>= 0.5, < 3.0)
rubyzip (~> 1.2, >= 1.2.2)
shoulda-matchers (4.1.2)
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.0)
silencer (1.0.1)
simple_token_authentication (1.16.0)
actionmailer (>= 3.2.6, < 7)
actionpack (>= 3.2.6, < 7)
devise (>= 3.2, < 6)
simplecov (0.17.0)
simplecov (0.21.2)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.2)
spinjs-rails (1.4)
rails (>= 3.1)
sprockets (4.0.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
stream (0.5.2)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
timecop (0.9.1)
tinymce-rails (4.9.10)
stream (0.5.3)
generator
thor (1.1.0)
tilt (2.0.10)
timecop (0.9.2)
tinymce-rails (4.9.11)
railties (>= 3.1.1)
turbolinks (5.1.1)
turbolinks-source (~> 5.1)
turbolinks-source (5.2.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
underscore-rails (1.8.3)
unicode-display_width (1.7.0)
uniform_notifier (1.12.1)
warden (1.2.8)
rack (>= 2.0.6)
webmock (3.7.2)
uniform_notifier (1.13.2)
warden (1.2.9)
rack (>= 2.0.9)
webmock (3.11.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
@ -585,7 +607,7 @@ GEM
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.1)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
whacamole (1.2.0)
@ -594,7 +616,7 @@ GEM
wkhtmltopdf-heroku (2.12.5.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.3.0)
zeitwerk (2.4.2)
PLATFORMS
ruby
@ -639,7 +661,7 @@ DEPENDENCIES
fastimage
figaro
hammerjs-rails
httparty (~> 0.13.1)
httparty (~> 0.17.3)
i18n-js (~> 3.6)
image_processing (~> 1.2)
jbuilder
@ -671,7 +693,7 @@ DEPENDENCIES
puma
rack-attack
rack-cors
rails (~> 6.0.0)
rails (~> 6.1.1)
rails-controller-testing
rails_12factor
rails_autolink (~> 1.1, >= 1.1.6)
@ -712,7 +734,7 @@ DEPENDENCIES
yomu!
RUBY VERSION
ruby 2.6.4p104
ruby 2.7.2p137
BUNDLED WITH
1.17.3
2.1.4

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
module ActiveStorage
module Blobs
class RedirectController < CustomBaseController
include ActiveStorage::SetBlob
include ActiveStorage::CheckBlobPermissions
def show
expires_in ActiveStorage.service_urls_expire_in
redirect_to @blob.url(disposition: params[:disposition])
end
end
end
end

View file

@ -1,13 +0,0 @@
# frozen_string_literal: true
module ActiveStorage
class BlobsController < CustomBaseController
include ActiveStorage::SetBlob
include ActiveStorage::CheckBlobPermissions
def show
expires_in ActiveStorage.service_urls_expire_in
redirect_to @blob.service_url(disposition: params[:disposition])
end
end
end

View file

@ -8,5 +8,11 @@ module ActiveStorage
prepend_before_action :authenticate_request!, if: -> { request.headers['Authorization'].present? }
skip_before_action :authenticate_user!, if: -> { current_user.present? }
private
def stream(_blob)
raise NotImplementedError
end
end
end

View file

@ -5,7 +5,7 @@ module ActiveStorage
before_action :check_file_size, only: :create
def create
blob = ActiveStorage::Blob.create_before_direct_upload!(blob_args)
blob = ActiveStorage::Blob.create_before_direct_upload!(**blob_args)
render json: direct_upload_json(blob)
end
@ -13,7 +13,7 @@ module ActiveStorage
def blob_args
args = params.require(:blob)
.permit(:filename, :byte_size, :checksum, :content_type, :metadata)
.permit(:filename, :byte_size, :checksum, :content_type, metadata: {})
.to_h
.symbolize_keys
args[:content_type] = 'application/octet-stream' if args[:content_type].blank?

View file

@ -0,0 +1,44 @@
# frozen_string_literal: true
module ActiveStorage
module Representations
class RedirectController < CustomBaseController
include ActiveStorage::SetBlob
include ActiveStorage::CheckBlobPermissions
def show
if @blob.attachments.take.record_type == 'Asset'
return render plain: '', status: :accepted unless preview_ready?
end
expires_in ActiveStorage.service_urls_expire_in
redirect_to @blob.representation(params[:variation_key]).processed.url(disposition: params[:disposition])
end
private
def preview_ready?
processing = @blob.attachments.take.record.file_processing
return false if processing
preview_exists =
if @blob.variable?
@blob.service.exist?(@blob.representation(params['variation_key']).key)
else
@blob.preview(params['variation_key']).image.attached?
end
return true if preview_exists
unless processing
ActiveStorage::PreviewJob.perform_later(@blob.id)
ActiveRecord::Base.no_touching do
@blob.attachments.take.record.update(file_processing: true)
end
end
false
end
end
end
end

View file

@ -1,42 +0,0 @@
# frozen_string_literal: true
module ActiveStorage
class RepresentationsController < CustomBaseController
include ActiveStorage::SetBlob
include ActiveStorage::CheckBlobPermissions
def show
if @blob.attachments.take.record_type == 'Asset'
return render plain: '', status: :accepted unless preview_ready?
end
expires_in ActiveStorage.service_urls_expire_in
redirect_to @blob.representation(params[:variation_key]).processed.service_url(disposition: params[:disposition])
end
private
def preview_ready?
processing = @blob.attachments.take.record.file_processing
return false if processing
preview_exists =
if @blob.variable?
@blob.service.exist?(@blob.representation(params['variation_key']).key)
else
@blob.preview(params['variation_key']).image.attached?
end
return true if preview_exists
unless processing
ActiveStorage::PreviewJob.perform_later(@blob.id)
ActiveRecord::Base.no_touching do
@blob.attachments.take.record.update(file_processing: true)
end
end
false
end
end
end

View file

@ -25,7 +25,7 @@ module Api
if @form_multipart_upload
asset = @step.assets.new(asset_params.merge({ team_id: @team.id }))
else
blob = ActiveStorage::Blob.create_after_upload!(
blob = ActiveStorage::Blob.create_and_upload!(
io: StringIO.new(Base64.decode64(asset_params[:file_data])),
filename: asset_params[:file_name],
content_type: asset_params[:file_type]

View file

@ -129,7 +129,7 @@ module Api
end
def create_blob_from_params
blob = ActiveStorage::Blob.create_after_upload!(
blob = ActiveStorage::Blob.create_and_upload!(
io: StringIO.new(Base64.decode64(result_file_params[:file_data])),
filename: result_file_params[:file_name],
content_type: result_file_params[:file_type]

View file

@ -215,7 +215,7 @@ class Asset < ApplicationRecord
raise ArgumentError, 'Destination asset should be persisted first!' unless to_asset.persisted?
file.blob.open do |tmp_file|
to_blob = ActiveStorage::Blob.create_after_upload!(io: tmp_file, filename: blob.filename, metadata: blob.metadata)
to_blob = ActiveStorage::Blob.create_and_upload!(io: tmp_file, filename: blob.filename, metadata: blob.metadata)
to_asset.file.attach(to_blob)
end
to_asset.post_process_file(to_asset.team)

View file

@ -194,7 +194,7 @@ class TinyMceAsset < ApplicationRecord
raise ArgumentError, 'Destination TinyMce asset should be persisted first!' unless to_asset.persisted?
image.blob.open do |tmp_file|
to_blob = ActiveStorage::Blob.create_after_upload!(io: tmp_file, filename: blob.filename, metadata: blob.metadata)
to_blob = ActiveStorage::Blob.create_and_upload!(io: tmp_file, filename: blob.filename, metadata: blob.metadata)
to_asset.image.attach(to_blob)
end
TinyMceAsset.update_estimated_size(to_asset.id)

View file

@ -11,7 +11,7 @@ module RepositoryActions
log_activity(:archive_inventory_item, row) if @log_activities
end
rescue ActiveRecord::RecordInvalid
@errors[:archiving_error] = I18n.t('repositories.archive_records.unsuccess_flash', @repository.name)
@errors[:archiving_error] = I18n.t('repositories.archive_records.unsuccess_flash', repository: @repository.name)
raise ActiveRecord::Rollback
end

View file

@ -11,7 +11,7 @@ module RepositoryActions
log_activity(:restore_inventory_item, row) if @log_activities
end
rescue ActiveRecord::RecordInvalid
@errors[:restoring_error] = I18n.t('repositories.restore_records.unsuccess_flash', @repository.name)
@errors[:restoring_error] = I18n.t('repositories.restore_records.unsuccess_flash', repository: @repository.name)
raise ActiveRecord::Rollback
end

View file

@ -157,7 +157,7 @@ module ProtocolsImporter
# Decode the file bytes
file = StringIO.new(Base64.decode64(tiny_mce_img_json['bytes']))
to_blob = ActiveStorage::Blob.create_after_upload!(io: file,
to_blob = ActiveStorage::Blob.create_and_upload!(io: file,
filename: tiny_mce_img_json['fileName'],
content_type: tiny_mce_img_json['fileType'],
metadata: JSON.parse(tiny_mce_img_json['fileMetadata'] || '{}'))

View file

@ -0,0 +1,18 @@
# This migration comes from active_storage (originally 20190112182829)
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
def up
unless column_exists?(:active_storage_blobs, :service_name)
add_column :active_storage_blobs, :service_name, :string
if configured_service = ActiveStorage::Blob.service.name
ActiveStorage::Blob.unscoped.update_all(service_name: configured_service)
end
change_column :active_storage_blobs, :service_name, :string, null: false
end
end
def down
remove_column :active_storage_blobs, :service_name
end
end

View file

@ -0,0 +1,12 @@
# This migration comes from active_storage (originally 20191206030411)
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
def change
create_table :active_storage_variant_records do |t|
t.belongs_to :blob, null: false, index: false
t.string :variation_digest, null: false
t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
t.foreign_key :active_storage_blobs, column: :blob_id
end
end
end

View file

@ -97,7 +97,8 @@ CREATE TABLE public.active_storage_blobs (
metadata text,
byte_size bigint NOT NULL,
checksum character varying NOT NULL,
created_at timestamp without time zone NOT NULL
created_at timestamp without time zone NOT NULL,
service_name character varying NOT NULL
);
@ -120,6 +121,36 @@ CREATE SEQUENCE public.active_storage_blobs_id_seq
ALTER SEQUENCE public.active_storage_blobs_id_seq OWNED BY public.active_storage_blobs.id;
--
-- Name: active_storage_variant_records; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.active_storage_variant_records (
id bigint NOT NULL,
blob_id bigint NOT NULL,
variation_digest character varying NOT NULL
);
--
-- Name: active_storage_variant_records_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.active_storage_variant_records_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: active_storage_variant_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.active_storage_variant_records_id_seq OWNED BY public.active_storage_variant_records.id;
--
-- Name: activities; Type: TABLE; Schema: public; Owner: -
--
@ -2835,6 +2866,13 @@ ALTER TABLE ONLY public.active_storage_attachments ALTER COLUMN id SET DEFAULT n
ALTER TABLE ONLY public.active_storage_blobs ALTER COLUMN id SET DEFAULT nextval('public.active_storage_blobs_id_seq'::regclass);
--
-- Name: active_storage_variant_records id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.active_storage_variant_records ALTER COLUMN id SET DEFAULT nextval('public.active_storage_variant_records_id_seq'::regclass);
--
-- Name: activities id; Type: DEFAULT; Schema: public; Owner: -
--
@ -3369,6 +3407,14 @@ ALTER TABLE ONLY public.active_storage_blobs
ADD CONSTRAINT active_storage_blobs_pkey PRIMARY KEY (id);
--
-- Name: active_storage_variant_records active_storage_variant_records_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.active_storage_variant_records
ADD CONSTRAINT active_storage_variant_records_pkey PRIMARY KEY (id);
--
-- Name: activities activities_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@ -4012,6 +4058,13 @@ CREATE UNIQUE INDEX index_active_storage_attachments_uniqueness ON public.active
CREATE UNIQUE INDEX index_active_storage_blobs_on_key ON public.active_storage_blobs USING btree (key);
--
-- Name: index_active_storage_variant_records_uniqueness; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_active_storage_variant_records_uniqueness ON public.active_storage_variant_records USING btree (blob_id, variation_digest);
--
-- Name: index_activities_on_created_at; Type: INDEX; Schema: public; Owner: -
--
@ -6358,6 +6411,14 @@ ALTER TABLE ONLY public.activities
ADD CONSTRAINT fk_rails_992865be13 FOREIGN KEY (experiment_id) REFERENCES public.experiments(id);
--
-- Name: active_storage_variant_records fk_rails_993965df05; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.active_storage_variant_records
ADD CONSTRAINT fk_rails_993965df05 FOREIGN KEY (blob_id) REFERENCES public.active_storage_blobs(id);
--
-- Name: reports fk_rails_9a0a9c9bec; Type: FK CONSTRAINT; Schema: public; Owner: -
--
@ -7090,4 +7151,8 @@ INSERT INTO "schema_migrations" (version) VALUES
('20201027133634'),
('20201028103608'),
('20201126203713'),
('20201209165626');
('20201209165626'),
('20210128105457'),
('20210128105458');

View file

@ -11,7 +11,7 @@ module ActiveStorage
end
end
def preview
def preview(**_options)
download_blob_to_tempfile do |input|
work_dir = File.dirname(input.path)
basename = File.basename(input.path, '.*')

View file

@ -1,82 +1,14 @@
# frozen_string_literal: true
# Copyright (c) 2017-2019 David Heinemeier Hansson, Basecamp
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
require 'aws-sdk-s3'
require 'active_support/core_ext/numeric/bytes'
require 'active_storage/service/s3_service'
module ActiveStorage
# Wraps the Amazon Simple Storage Service (S3) as an Active Storage service.
# See ActiveStorage::Service for the generic API documentation that applies to all services.
class Service::CustomS3Service < Service
attr_reader :client, :bucket, :upload_options
class Service::CustomS3Service < Service::S3Service
attr_reader :subfolder
def initialize(bucket:, upload: {}, **options)
def initialize(bucket:, upload: {}, public: false, **options)
@subfolder = options.delete(:subfolder)
@client = Aws::S3::Resource.new(**options)
@bucket = @client.bucket(bucket)
@upload_options = upload
end
def upload(key, io, checksum: nil, content_type: nil, **)
instrument :upload, key: key, checksum: checksum do
object_for(key).put(upload_options.merge(body: io, content_md5: checksum, content_type: content_type))
rescue Aws::S3::Errors::BadDigest
raise ActiveStorage::IntegrityError
end
end
def download(key, &block)
if block_given?
instrument :streaming_download, key: key do
stream(key, &block)
end
else
instrument :download, key: key do
object_for(key).get.body.string.force_encoding(Encoding::BINARY)
rescue Aws::S3::Errors::NoSuchKey
raise ActiveStorage::FileNotFoundError
end
end
end
def download_chunk(key, range)
instrument :download_chunk, key: key, range: range do
object_for(key).get(range: "bytes=#{range.begin}-#{range.exclude_end? ? range.end - 1 : range.end}")
.body
.read
.force_encoding(Encoding::BINARY)
rescue Aws::S3::Errors::NoSuchKey
raise ActiveStorage::FileNotFoundError
end
end
def delete(key)
instrument :delete, key: key do
object_for(key).delete
end
super
end
def delete_prefixed(prefix)
@ -86,66 +18,11 @@ module ActiveStorage
end
end
def exist?(key)
instrument :exist, key: key do |payload|
answer = object_for(key).exists?
payload[:exist] = answer
answer
end
end
def url(key, expires_in:, filename:, disposition:, content_type:)
instrument :url, key: key do |payload|
generated_url = object_for(key).presigned_url :get, expires_in: expires_in.to_i,
response_content_disposition: content_disposition_with(type: disposition, filename: filename),
response_content_type: content_type
payload[:url] = generated_url
generated_url
end
end
def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)
instrument :url, key: key do |payload|
generated_url = object_for(key).presigned_url :put, expires_in: expires_in.to_i,
content_type: content_type, content_length: content_length, content_md5: checksum,
whitelist_headers: ['content-length']
payload[:url] = generated_url
generated_url
end
end
def headers_for_direct_upload(_, content_type:, checksum:, **)
{ 'Content-Type' => content_type, 'Content-MD5' => checksum }
end
def path_for(key)
subfolder.present? ? File.join(subfolder, key) : key
end
private
def object_for(key)
key = subfolder.present? ? File.join(subfolder, key) : key
bucket.object(key)
end
# Reads the object for the given key in chunks, yielding each to the block.
def stream(key)
object = object_for(key)
chunk_size = 5.megabytes
offset = 0
raise ActiveStorage::FileNotFoundError unless object.exists?
while offset < object.content_length
yield object.get(range: "bytes=#{offset}-#{offset + chunk_size - 1}").body.read.force_encoding(Encoding::BINARY)
offset += chunk_size
end
end
end
end

View file

@ -80,7 +80,7 @@ describe ProtocolsController, type: :controller do
{
team_id: team.id,
type: 'public',
# protocol: fixture_file_upload('files/my_test_protocol.eln',
# protocol: file_fixture('files/my_test_protocol.eln',
# 'application/json'),
# Not sure where should I attache file?
protocol: {

View file

@ -140,8 +140,7 @@ describe RepositoriesController, type: :controller do
end
it 'adds activity in DB' do
ImportRepository::ImportRecords.any_instance.stub(:import!)
.and_return(status: :ok)
allow_any_instance_of(ImportRepository::ImportRecords).to receive(:import!).and_return(status: :ok)
expect { action }
.to(change { Activity.count })

View file

@ -24,7 +24,7 @@ describe ResultAssetsController, type: :controller do
{ my_module_id: task.id,
results_names: { '0': 'result name created' },
results_files:
{ '0': fixture_file_upload('files/export.csv', 'text/csv') } }
{ '0': file_fixture('files/export.csv', 'text/csv') } }
end
#it 'calls create activity service' do

View file

@ -139,7 +139,7 @@ RSpec.describe 'Api::V1::AssetsController', type: :request do
context 'when has valid params' do
context 'when multipart form' do
let(:file) { fixture_file_upload('files/test.jpg', 'image/jpg') }
let(:file) { Rack::Test::UploadedFile.new(file_fixture('test.jpg').open) }
let(:attributes) { { file: file } }
it 'creates new asset' do

View file

@ -231,8 +231,7 @@ RSpec.describe 'Api::V1::InventoryStatusItemsController', type: :request do
context 'when user does not has manage permissions' do
it 'renders 403' do
@user_team.role = :guest
@user_team.save
@user_team.reload.update!(role: :guest)
action
@ -240,8 +239,7 @@ RSpec.describe 'Api::V1::InventoryStatusItemsController', type: :request do
end
it 'does not creats an item' do
@user_team.role = :guest
@user_team.save
@user_team.reload.update!(role: :guest)
expect { action }.not_to(change { RepositoryStatusItem.count })
end
@ -369,8 +367,7 @@ RSpec.describe 'Api::V1::InventoryStatusItemsController', type: :request do
context 'when user does not has manage permissions' do
it 'renders 403' do
@user_team.role = :guest
@user_team.save
@user_team.reload.update!(role: :guest)
action
@ -447,8 +444,7 @@ RSpec.describe 'Api::V1::InventoryStatusItemsController', type: :request do
context 'when user does not has manage permissions' do
it 'renders 403' do
@user_team.role = :guest
@user_team.save
@user_team.reload.update!(role: :guest)
action
@ -456,8 +452,7 @@ RSpec.describe 'Api::V1::InventoryStatusItemsController', type: :request do
end
it 'does not delets any item' do
@user_team.role = :guest
@user_team.save
@user_team.reload.update!(role: :guest)
expect { action }.not_to(change { RepositoryStatusItem.count })
end

View file

@ -316,7 +316,7 @@ RSpec.describe 'Api::V1::ResultsController', type: :request do
end
context 'when sending multipart form' do
let(:attributes) { { file: fixture_file_upload('files/test.jpg', 'image/jpg') } }
let(:attributes) { { file: Rack::Test::UploadedFile.new(file_fixture('test.jpg').open) } }
it 'creates new asset' do
expect { action }.to change { ResultAsset.count }.by(1)
@ -395,7 +395,7 @@ RSpec.describe 'Api::V1::ResultsController', type: :request do
describe 'PUT result, #update' do
context 'when resultType is file' do
let(:result_file) { @valid_task.results.last }
let(:file) { fixture_file_upload('files/test.jpg', 'image/jpg') }
let(:file) { Rack::Test::UploadedFile.new(file_fixture('test.jpg').open) }
let(:request_body) do
{
data: {
@ -477,7 +477,7 @@ RSpec.describe 'Api::V1::ResultsController', type: :request do
end
context 'when sending multipart form' do
let(:attributes) { { file: fixture_file_upload('files/apple.jpg', 'image/jpg') } }
let(:attributes) { { file: Rack::Test::UploadedFile.new(file_fixture('apple.jpg').open) } }
it 'returns status 200' do
action

View file

@ -25,7 +25,7 @@ describe RepositoryImportParser::Importer do
end
let(:sheet) do
SpreadsheetParser.open_spreadsheet(fixture_file_upload('files/export.csv'))
SpreadsheetParser.open_spreadsheet(file_fixture('export.csv').open)
end
let(:mappings) do
{ '0' => '-1',