diff options
Diffstat (limited to 'spec/models/analytics/cycle_analytics/stage_event_hash_spec.rb')
-rw-r--r-- | spec/models/analytics/cycle_analytics/stage_event_hash_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/models/analytics/cycle_analytics/stage_event_hash_spec.rb b/spec/models/analytics/cycle_analytics/stage_event_hash_spec.rb index ffddaf1e1b2..43db610af5c 100644 --- a/spec/models/analytics/cycle_analytics/stage_event_hash_spec.rb +++ b/spec/models/analytics/cycle_analytics/stage_event_hash_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Analytics::CycleAnalytics::StageEventHash, type: :model do let(:hash_sha256) { 'does_not_matter' } describe 'associations' do - it { is_expected.to have_many(:cycle_analytics_project_stages) } + it { is_expected.to have_many(:cycle_analytics_stages) } end describe 'validations' do @@ -30,14 +30,14 @@ RSpec.describe Analytics::CycleAnalytics::StageEventHash, type: :model do end describe '.cleanup_if_unused' do - it 'removes the record' do + it 'removes the record if there is no stages with given stage events hash' do described_class.cleanup_if_unused(stage_event_hash.id) expect(described_class.find_by_id(stage_event_hash.id)).to be_nil end - it 'does not remove the record' do - id = create(:cycle_analytics_project_stage).stage_event_hash_id + it 'does not remove the record if at least 1 group stage for the given stage events hash exists' do + id = create(:cycle_analytics_stage).stage_event_hash_id described_class.cleanup_if_unused(id) |