From c5780927a8efb619787cb627de6d73488ec4c9d6 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Wed, 6 Feb 2019 22:07:54 +0100 Subject: [PATCH] Change a test to work with multiple tests run at the same time --- spec/services/model_importers/team_importer_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/services/model_importers/team_importer_spec.rb b/spec/services/model_importers/team_importer_spec.rb index e0d85c506..4ca8e32ae 100644 --- a/spec/services/model_importers/team_importer_spec.rb +++ b/spec/services/model_importers/team_importer_spec.rb @@ -19,12 +19,16 @@ describe TeamImporter do create :user @user = create :user @team = create :team - create :project, name: 'Placeholder project', visibility: 1, + create :project, name: 'Temp project', visibility: 1, team: @team, archived: false, created_at: time @project = create :project, name: 'Project', visibility: 1, team: @team, archived: false, created_at: time + # Reassign if multiple tests are run + PROJECT_ID = @project.id + USER_ID = @user.id + @team_importer = TeamImporter.new @exp = @team_importer.import_experiment_template_from_dir(TEMPLATE_DIR, PROJECT_ID, @@ -32,7 +36,6 @@ describe TeamImporter do end describe 'Experiment variables' do - it { expect(@exp.id).to eq 1 } it { expect(@exp.project.id).to eq PROJECT_ID } it { expect(@exp.name).to eq 'Experiment export' } it { expect(@exp.description).to eq 'My description' }