Fix failing tests [SCI-3908]

This commit is contained in:
Oleksii Kriuchykhin 2019-10-04 13:02:18 +02:00
parent 52bbf6740d
commit 9d2ac4179e
10 changed files with 5 additions and 52 deletions

View file

@ -104,8 +104,6 @@ class ExperimentsController < ApplicationController
end
log_activity(activity_type)
@experiment.touch(:workflowimg_updated_at)
respond_to do |format|
format.json do
render json: {}, status: :ok

View file

@ -79,7 +79,6 @@ module Experiments
@exp.workflowimg.attach(io: file, filename: File.basename(file.path))
file.close
file.unlink
@exp.touch(:workflowimg_updated_at)
end
end
end

View file

@ -17,10 +17,6 @@ describe Asset, type: :model do
it { should have_db_column :id }
it { should have_db_column :created_at }
it { should have_db_column :updated_at }
it { should have_db_column :file_file_name }
it { should have_db_column :file_content_type }
it { should have_db_column :file_file_size }
it { should have_db_column :file_updated_at }
it { should have_db_column :created_by_id }
it { should have_db_column :last_modified_by_id }
it { should have_db_column :estimated_size }

View file

@ -27,10 +27,6 @@ describe Experiment, type: :model do
it { should have_db_column :restored_on }
it { should have_db_column :created_at }
it { should have_db_column :updated_at }
it { should have_db_column :workflowimg_file_name }
it { should have_db_column :workflowimg_content_type }
it { should have_db_column :workflowimg_file_size }
it { should have_db_column :workflowimg_updated_at }
it { should have_db_column :uuid }
end

View file

@ -17,10 +17,6 @@ describe TempFile, type: :model do
it { should have_db_column :session_id }
it { should have_db_column :created_at }
it { should have_db_column :updated_at }
it { should have_db_column :file_file_name }
it { should have_db_column :file_content_type }
it { should have_db_column :file_file_size }
it { should have_db_column :file_updated_at }
end
describe 'Validations' do

View file

@ -8,10 +8,6 @@ describe TinyMceAsset, type: :model do
end
describe 'Database table' do
it { should have_db_column :image_file_name }
it { should have_db_column :image_content_type }
it { should have_db_column :image_file_size }
it { should have_db_column :image_updated_at }
it { should have_db_column :estimated_size }
it { should have_db_column :object_id }
it { should have_db_column :object_type }

View file

@ -27,10 +27,6 @@ describe User, type: :model do
it { should have_db_column :last_sign_in_ip }
it { should have_db_column :created_at }
it { should have_db_column :updated_at }
it { should have_db_column :avatar_file_name }
it { should have_db_column :avatar_content_type }
it { should have_db_column :avatar_file_size }
it { should have_db_column :avatar_updated_at }
it { should have_db_column :confirmation_token }
it { should have_db_column :confirmed_at }
it { should have_db_column :confirmation_sent_at }

View file

@ -17,10 +17,6 @@ describe ZipExport, type: :model do
it { should have_db_column :user_id }
it { should have_db_column :created_at }
it { should have_db_column :updated_at }
it { should have_db_column :zip_file_file_name }
it { should have_db_column :zip_file_content_type }
it { should have_db_column :zip_file_file_size }
it { should have_db_column :zip_file_updated_at }
end
describe 'Relations' do

View file

@ -12,11 +12,7 @@
"project_id": 1,
"restored_by_id": null,
"restored_on": null,
"updated_at": "2019-01-21T13:32:46.473Z",
"workflowimg_content_type": "image/png",
"workflowimg_file_name": "wimg20190121-1-111oj8z.png",
"workflowimg_file_size": 4581,
"workflowimg_updated_at": "2019-01-21T13:31:04.682Z"
"updated_at": "2019-01-21T13:32:46.473Z"
},
"my_module_groups": [
{
@ -307,12 +303,8 @@
"created_at": "2019-01-21T13:09:35.615Z",
"created_by_id": 1,
"estimated_size": 17799,
"file_content_type": null,
"file_file_name": null,
"file_file_size": null,
"file_present": true,
"file_processing": null,
"file_updated_at": "2019-01-21T13:10:05.392Z",
"id": 21,
"last_modified_by_id": null,
"lock": null,
@ -608,12 +600,8 @@
"created_at": "2019-01-21T12:45:29.138Z",
"created_by_id": 1,
"estimated_size": 232,
"file_content_type": null,
"file_file_name": null,
"file_file_size": null,
"file_present": true,
"file_processing": null,
"file_updated_at": "2019-01-21T12:45:28.889Z",
"id": 1,
"last_modified_by_id": 1,
"lock": null,
@ -1087,12 +1075,8 @@
"created_at": "2019-01-21T12:45:32.296Z",
"created_by_id": 1,
"estimated_size": 1129370,
"file_content_type": null,
"file_file_name": null,
"file_file_size": null,
"file_present": true,
"file_processing": null,
"file_updated_at": "2019-01-21T12:45:32.237Z",
"id": 8,
"last_modified_by_id": 1,
"lock": null,
@ -1143,12 +1127,8 @@
"created_at": "2019-01-21T12:45:32.847Z",
"created_by_id": 1,
"estimated_size": 46131,
"file_content_type": null,
"file_file_name": null,
"file_file_size": null,
"file_present": true,
"file_processing": null,
"file_updated_at": "2019-01-21T12:45:43.655Z",
"id": 9,
"last_modified_by_id": 1,
"lock": null,

View file

@ -51,8 +51,8 @@ describe TemplatesService do
expect(tmpl_res.name).to eq(demo_res.name)
if demo_res.asset
expect(tmpl_res.asset.file.attached?).to eq(true)
expect(demo_res.asset.file_file_name)
.to eq(tmpl_res.asset.file_file_name)
expect(demo_res.asset.file_name)
.to eq(tmpl_res.asset.file_name)
elsif demo_res.table
expect(demo_res.table.contents).to eq(tmpl_res.table.contents)
elsif demo_res.result_text
@ -71,8 +71,8 @@ describe TemplatesService do
expect(demo_step.name).to eq(tmpl_step.name)
expect(demo_step.description).to eq(tmpl_step.description)
if demo_step.assets.present?
expect(demo_step.assets.pluck(:file_file_name))
.to match_array(tmpl_step.assets.pluck(:file_file_name))
expect(demo_step.assets.map(&:file_name))
.to match_array(tmpl_step.assets.map(&:file_name))
end
tmpl_step.assets.each do |asset|
expect(asset.file.attached?).to eq(true)