2018-05-02 04:12:20 -04:00
|
|
|
require "spec_helper"
|
2017-10-24 02:38:06 -04:00
|
|
|
|
|
|
|
describe ::Applications::CreateService do
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:params) { attributes_for(:application) }
|
2018-05-02 04:12:20 -04:00
|
|
|
let(:request) do
|
|
|
|
if Gitlab.rails5?
|
|
|
|
ActionController::TestRequest.new({ remote_ip: "127.0.0.1" }, ActionController::TestSession.new)
|
|
|
|
else
|
|
|
|
ActionController::TestRequest.new(remote_ip: "127.0.0.1")
|
|
|
|
end
|
|
|
|
end
|
2017-10-24 02:38:06 -04:00
|
|
|
|
|
|
|
subject { described_class.new(user, params) }
|
|
|
|
|
2018-05-02 04:12:20 -04:00
|
|
|
it { expect { subject.execute(request) }.to change { Doorkeeper::Application.count }.by(1) }
|
2017-10-24 02:38:06 -04:00
|
|
|
end
|