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

fix specs

parent 232bdd47
...@@ -19,7 +19,7 @@ class Admin::ApplicationsController < Admin::ApplicationController ...@@ -19,7 +19,7 @@ class Admin::ApplicationsController < Admin::ApplicationController
end end
def create 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? if @application.persisted?
flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create]) flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])
......
...@@ -3,10 +3,11 @@ require 'spec_helper' ...@@ -3,10 +3,11 @@ require 'spec_helper'
describe ::Applications::CreateService do describe ::Applications::CreateService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:params) { attributes_for(:application) } let(:params) { attributes_for(:application) }
let(:request) { ActionController::TestRequest.new(remote_ip: '127.0.0.1') }
subject { described_class.new(user, params) } subject { described_class.new(user, params) }
it 'creates an application' do 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
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