Merge branch 'blackst0ne-rails5-fix-create-service-spec' into 'master'

[Rails5] Fix spec/services/applications/create_service_spec.rb

See merge request gitlab-org/gitlab-ce!18665
This commit is contained in:
Rémy Coutable 2018-05-02 08:12:20 +00:00
commit 8d74af1029

View file

@ -1,13 +1,17 @@
require 'spec_helper'
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') }
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
subject { described_class.new(user, params) }
it 'creates an application' do
expect { subject.execute(request) }.to change { Doorkeeper::Application.count }.by(1)
end
it { expect { subject.execute(request) }.to change { Doorkeeper::Application.count }.by(1) }
end