fix specs

This commit is contained in:
James Lopez 2017-11-02 08:49:36 +01:00
parent 232bdd47d9
commit 37eb00ce5b
2 changed files with 3 additions and 2 deletions

View file

@ -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])

View file

@ -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