Change a test to work with multiple tests run at the same time

This commit is contained in:
Jure Grabnar 2019-02-06 22:07:54 +01:00
parent 6ae82401f3
commit c5780927a8

View file

@ -19,12 +19,16 @@ describe TeamImporter do
create :user create :user
@user = create :user @user = create :user
@team = create :team @team = create :team
create :project, name: 'Placeholder project', visibility: 1, create :project, name: 'Temp project', visibility: 1,
team: @team, archived: false, created_at: time team: @team, archived: false, created_at: time
@project = create :project, name: 'Project', visibility: 1, team: @team, @project = create :project, name: 'Project', visibility: 1, team: @team,
archived: false, created_at: time archived: false, created_at: time
# Reassign if multiple tests are run
PROJECT_ID = @project.id
USER_ID = @user.id
@team_importer = TeamImporter.new @team_importer = TeamImporter.new
@exp = @team_importer.import_experiment_template_from_dir(TEMPLATE_DIR, @exp = @team_importer.import_experiment_template_from_dir(TEMPLATE_DIR,
PROJECT_ID, PROJECT_ID,
@ -32,7 +36,6 @@ describe TeamImporter do
end end
describe 'Experiment variables' do describe 'Experiment variables' do
it { expect(@exp.id).to eq 1 }
it { expect(@exp.project.id).to eq PROJECT_ID } it { expect(@exp.project.id).to eq PROJECT_ID }
it { expect(@exp.name).to eq 'Experiment export' } it { expect(@exp.name).to eq 'Experiment export' }
it { expect(@exp.description).to eq 'My description' } it { expect(@exp.description).to eq 'My description' }