From 91f016939d7606333708c66971ea397e4f40a442 Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Wed, 20 Jan 2021 09:01:26 +0100 Subject: [PATCH] Fix tests for result deletion SCI-5429 --- spec/controllers/results_controller_spec.rb | 2 +- spec/factories/results.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/controllers/results_controller_spec.rb b/spec/controllers/results_controller_spec.rb index 91905cf1b..6201e8989 100644 --- a/spec/controllers/results_controller_spec.rb +++ b/spec/controllers/results_controller_spec.rb @@ -14,7 +14,7 @@ describe ResultsController, type: :controller do let(:experiment) { create :experiment, project: project } let(:task) { create :my_module, name: 'test task', experiment: experiment } let(:result) do - create :result, name: 'test result', my_module: task, user: user + create :result, :archived, name: 'test result', my_module: task, user: user end let!(:result_text) do create :result_text, text: 'test text result', result: result diff --git a/spec/factories/results.rb b/spec/factories/results.rb index c0a52e451..2dee8bd5e 100644 --- a/spec/factories/results.rb +++ b/spec/factories/results.rb @@ -5,5 +5,10 @@ FactoryBot.define do name { Faker::Name.unique.name } user my_module + trait :archived do + archived { true } + archived_on { Time.zone.now } + archived_by { user } + end end end