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

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

require 'spec_helper'

RSpec.describe Gitlab::Audit::UnauthenticatedAuthor do
  describe '#initialize' do
    it 'sets correct attributes' do
      expect(described_class.new(name: 'Peppa Pig'))
        .to have_attributes(id: -1, name: 'Peppa Pig')
    end

    it 'sets default name when it is not provided' do
      expect(described_class.new)
        .to have_attributes(id: -1, name: 'An unauthenticated user')
    end

    describe '#impersonated?' do
      it 'returns false' do
        expect(described_class.new.impersonated?).to be(false)
      end
    end
  end
end