# frozen_string_literal: true

require 'spec_helper'

shared_examples 'VulnerabilityFindingsActions disabled' do
  include ApiHelpers
  include VulnerableHelpers

  let(:action_params) { vulnerable_params }
  let(:user) { create(:user) }

  before do
    vulnerable.add_developer(user)

    sign_in(user)
    stub_licensed_features(security_dashboard: true)
  end

  describe 'GET index.json' do
    subject { get :index, params: action_params, format: :json }

    it 'is disabled and returns "not found"' do
      subject

      expect(response).to have_gitlab_http_status(404)
    end
  end

  describe 'GET summary.json' do
    subject { get :summary, params: action_params, format: :json }

    before do
      subject
    end

    it 'is disabled and returns "not found"' do
      expect(response).to have_gitlab_http_status(404)
    end
  end
end
