Commit 37eb00ce authored by James Lopez's avatar James Lopez

fix specs

parent 232bdd47
......@@ -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
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