2017-10-24 02:38:06 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe ::Applications::CreateService do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:params) { attributes_for(:application) }
|
2017-11-02 03:49:36 -04:00
|
|
|
let(:request) { ActionController::TestRequest.new(remote_ip: '127.0.0.1') }
|
2017-10-24 02:38:06 -04:00
|
|
|
|
|
|
|
subject { described_class.new(user, params) }
|
|
|
|
|
|
|
|
it 'creates an application' do
|
2017-11-02 03:49:36 -04:00
|
|
|
expect { subject.execute(request) }.to change { Doorkeeper::Application.count }.by(1)
|
2017-10-24 02:38:06 -04:00
|
|
|
end
|
|
|
|
end
|