debian-mirror-gitlab/spec/views/profiles/audit_log.html.haml_spec.rb

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

27 lines
659 B
Ruby
Raw Normal View History

2021-12-11 22:18:48 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'profiles/audit_log' do
let(:user) { create(:user) }
before do
assign(:user, user)
assign(:events, AuthenticationEvent.all.page(params[:page]))
allow(controller).to receive(:current_user).and_return(user)
end
context 'when user has successful and failure events' do
before do
create(:authentication_event, :successful, user: user)
create(:authentication_event, :failed, user: user)
end
it 'only shows successful events' do
render
expect(rendered).to have_text('Signed in with standard authentication', count: 1)
end
end
end