diff options
Diffstat (limited to 'spec/models/ml/candidate_spec.rb')
-rw-r--r-- | spec/models/ml/candidate_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/ml/candidate_spec.rb b/spec/models/ml/candidate_spec.rb index f58d30f81a0..3bf1e80a152 100644 --- a/spec/models/ml/candidate_spec.rb +++ b/spec/models/ml/candidate_spec.rb @@ -2,7 +2,9 @@ require 'spec_helper' -RSpec.describe Ml::Candidate do +RSpec.describe Ml::Candidate, factory_default: :keep do + let_it_be(:candidate) { create_default(:ml_candidates, :with_metrics_and_params) } + describe 'associations' do it { is_expected.to belong_to(:experiment) } it { is_expected.to belong_to(:user) } @@ -12,13 +14,11 @@ RSpec.describe Ml::Candidate do describe '#new' do it 'iid is not null' do - expect(create(:ml_candidates).iid).not_to be_nil + expect(candidate.iid).not_to be_nil end end - describe 'by_project_id_and_iid' do - let_it_be(:candidate) { create(:ml_candidates) } - + describe '#by_project_id_and_iid' do let(:project_id) { candidate.experiment.project_id } let(:iid) { candidate.iid } |