fix specs
This commit is contained in:
parent
232bdd47d9
commit
37eb00ce5b
2 changed files with 3 additions and 2 deletions
|
@ -19,7 +19,7 @@ class Admin::ApplicationsController < Admin::ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
@application = Applications::CreateService.new(current_user, application_params.merge.execute(request)
|
||||
@application = Applications::CreateService.new(current_user, application_params.merge.execute(request))
|
||||
|
||||
if @application.persisted?
|
||||
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])
|
||||
|
|
|
@ -3,10 +3,11 @@ 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 application' do
|
||||
expect { subject.execute }.to change { Doorkeeper::Application.count }.by(1)
|
||||
expect { subject.execute(request) }.to change { Doorkeeper::Application.count }.by(1)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue