Commit 5457f295 authored by James Lopez's avatar James Lopez

add application service

parent 917e7187
module Applications
class CreateService < ::Emails::BaseService
#prepend ::EE::Applications::CreateService
def initialize(current_user, params)
@current_user = current_user
@params = params
end
def execute
Doorkeeper::Application.create(@params)
end
end
end
require 'spec_helper'
describe ::Applications::CreateService do
let(:user) { create(:user) }
let(:params) { attributes_for(:application) }
subject { described_class.new(user, params) }
it 'creates an application' do
expect { subject.execute }.to change { Doorkeeper::Application.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