Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveStorage::IntegrityError: ActiveStorage::IntegrityError #57

Closed
x1wins opened this issue Aug 26, 2021 · 1 comment · Fixed by #58
Closed

ActiveStorage::IntegrityError: ActiveStorage::IntegrityError #57

x1wins opened this issue Aug 26, 2021 · 1 comment · Fixed by #58
Assignees
Labels
dependencies Pull requests that update a dependency file rails 6.1 rails version upgrade system-error

Comments

@x1wins
Copy link
Owner

x1wins commented Aug 26, 2021

% docker-compose run --no-deps web bundle exec rspec --format documentation

Creating cw-ovp_web_run ... done

EncodesController
  GET #index
    returns a success response (FAILED - 1)
  GET #show
    returns a success response (FAILED - 2)
  GET #new
    returns a success response
  POST #create
    with valid params
      creates a new Encode
      redirects to the created encode
    with invalid params
      returns a success response (i.e. to display the 'new' template)

EncodesController
  routing
    routes to #index
    routes to #new
    routes to #show
    routes to #create

encodes/index
  renders a list of encodes (FAILED - 3)

encodes/new
  renders new encode form

encodes/show
  renders attributes in <p> (FAILED - 4)

Failures:

  1) EncodesController GET #index returns a success response
     Failure/Error: Encode.create! valid_attributes
     
     ActiveStorage::IntegrityError:
       ActiveStorage::IntegrityError
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:159:in `ensure_integrity_of'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:22:in `block in upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service.rb:155:in `instrument'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:20:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/app/models/active_storage/blob.rb:253:in `upload_without_unfurling'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/changes/create_one.rb:26:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/model.rb:77:in `block in has_one_attached'
     # ./spec/controllers/encodes_controller_spec.rb:48:in `block (3 levels) in <top (required)>'

  2) EncodesController GET #show returns a success response
     Failure/Error: encode = Encode.create! valid_attributes
     
     ActiveStorage::IntegrityError:
       ActiveStorage::IntegrityError
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:159:in `ensure_integrity_of'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:22:in `block in upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service.rb:155:in `instrument'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:20:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/app/models/active_storage/blob.rb:253:in `upload_without_unfurling'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/changes/create_one.rb:26:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/model.rb:77:in `block in has_one_attached'
     # ./spec/controllers/encodes_controller_spec.rb:56:in `block (3 levels) in <top (required)>'

  3) encodes/index renders a list of encodes
     Failure/Error: Encode.create!(title: "hello", user: @user, file: Rack::Test::UploadedFile.new(Rails.root.join("spec/factories/sample.mp4")))
     
     ActiveStorage::IntegrityError:
       ActiveStorage::IntegrityError
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:159:in `ensure_integrity_of'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:22:in `block in upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service.rb:155:in `instrument'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:20:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/app/models/active_storage/blob.rb:253:in `upload_without_unfurling'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/changes/create_one.rb:26:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/model.rb:77:in `block in has_one_attached'
     # ./spec/views/encodes/index.html.erb_spec.rb:8:in `block (2 levels) in <main>'

  4) encodes/show renders attributes in <p>
     Failure/Error: @encode = assign(:encode, Encode.create!(title: @title, user: @user, file: Rack::Test::UploadedFile.new(Rails.root.join("spec/factories/sample.mp4"))))
     
     ActiveStorage::IntegrityError:
       ActiveStorage::IntegrityError
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:159:in `ensure_integrity_of'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:22:in `block in upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service.rb:155:in `instrument'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/service/disk_service.rb:20:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/app/models/active_storage/blob.rb:253:in `upload_without_unfurling'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/changes/create_one.rb:26:in `upload'
     # /usr/local/bundle/ruby/2.6.0/gems/activestorage-6.1.4.1/lib/active_storage/attached/model.rb:77:in `block in has_one_attached'
     # ./spec/views/encodes/show.html.erb_spec.rb:7:in `block (2 levels) in <main>'

Finished in 8.5 seconds (files took 9.43 seconds to load)
13 examples, 4 failures

Failed examples:

rspec ./spec/controllers/encodes_controller_spec.rb:47 # EncodesController GET #index returns a success response
rspec ./spec/controllers/encodes_controller_spec.rb:55 # EncodesController GET #show returns a success response
rspec ./spec/views/encodes/index.html.erb_spec.rb:12 # encodes/index renders a list of encodes
rspec ./spec/views/encodes/show.html.erb_spec.rb:10 # encodes/show renders attributes in <p>

ERROR: 1

image

@x1wins x1wins self-assigned this Aug 26, 2021
@x1wins x1wins added dependencies Pull requests that update a dependency file rails 6.1 rails version upgrade system-error labels Aug 26, 2021
@x1wins
Copy link
Owner Author

x1wins commented Aug 26, 2021

@x1wins x1wins linked a pull request Aug 26, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file rails 6.1 rails version upgrade system-error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant