Welcome to mirror list, hosted at ThFree Co, Russian Federation.

abuse_report_event_spec.rb « resource_events « models « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d454632c906390c732ec960c62b12725f111c155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ResourceEvents::AbuseReportEvent, feature_category: :instance_resiliency, type: :model do
  include ResourceEvents::AbuseReportEventsHelper

  subject(:event) { build(:abuse_report_event) }

  describe 'associations' do
    it { is_expected.to belong_to(:abuse_report).required }
    it { is_expected.to belong_to(:user).optional }
  end

  describe 'validations' do
    it { is_expected.to be_valid }
    it { is_expected.to validate_presence_of(:action) }
  end

  describe '#success_message' do
    it 'returns a success message for the action' do
      expect(event.success_message).to eq(success_message_for_action(event.action))
    end
  end
end