debian-mirror-gitlab/spec/services/applications/create_service_spec.rb

18 lines
524 B
Ruby
Raw Normal View History

2018-10-15 14:42:47 +05:30
require "spec_helper"
2018-03-17 18:26:18 +05:30
describe ::Applications::CreateService do
let(:user) { create(:user) }
let(:params) { attributes_for(:application) }
2018-10-15 14:42:47 +05:30
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
2018-03-17 18:26:18 +05:30
subject { described_class.new(user, params) }
2018-10-15 14:42:47 +05:30
it { expect { subject.execute(request) }.to change { Doorkeeper::Application.count }.by(1) }
2018-03-17 18:26:18 +05:30
end