debian-mirror-gitlab/spec/policies/instance_metadata_policy_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
421 B
Ruby
Raw Normal View History

2021-01-29 00:20:46 +05:30
# 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