debian-mirror-gitlab/spec/policies/instance_metadata_policy_spec.rb
2021-01-29 00:20:46 +05:30

19 lines
421 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe InstanceMetadataPolicy do
subject { described_class.new(user, InstanceMetadata.new) }
context 'for any logged-in user' do
let(:user) { create(:user) }
specify { expect_allowed(:read_instance_metadata) }
end
context 'for anonymous users' do
let(:user) { nil }
specify { expect_disallowed(:read_instance_metadata) }
end
end