Commit 9fb5c1bd authored by James Lopez's avatar James Lopez

refactor and add more specs

parent 95c29671
require 'spec_helper'
describe ::Applications::CreateService do
let(:user) { create(:user) }
let(:params) { attributes_for(:application) }
let(:request) { ActionController::TestRequest.new(remote_ip: '127.0.0.1') }
subject { described_class.new(user, params) }
it 'creates an audit log' do
stub_licensed_features(extended_audit_events: true)
expect { subject.execute(request) }.to change { SecurityEvent.count }.by(1)
end
end
require 'spec_helper'
describe Keys::CreateService do
let(:user) { create(:user) }
let(:params) { attributes_for(:key) }
subject { described_class.new(user, params) }
it 'creates' do
stub_licensed_features(extended_audit_events: true)
expect { subject.execute }.to change { SecurityEvent.count }.by(1)
end
end
......@@ -10,10 +10,4 @@ describe ::Applications::CreateService do
it 'creates an application' do
expect { subject.execute(request) }.to change { Doorkeeper::Application.count }.by(1)
end
it 'creates an audit log' do
stub_licensed_features(extended_audit_events: true)
expect { subject.execute(request) }.to change { SecurityEvent.count }.by(1)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment