diff options
author | Rémy Coutable <remy@rymai.me> | 2018-05-02 11:12:20 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-02 11:12:20 +0300 |
commit | 8d74af102941aa0b51e1a35b8ad731284e4b5a20 (patch) | |
tree | 3352272b6faaae2724fe973acd6e76724ee2787c /spec | |
parent | bdb238a0651e0c517e461afbb9d28f1653a97596 (diff) | |
parent | 2bf949806b6911370f47522b8aa88ed84afb01ba (diff) |
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
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/applications/create_service_spec.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/services/applications/create_service_spec.rb b/spec/services/applications/create_service_spec.rb index 47a2a9d6403..9c43b56744b 100644 --- a/spec/services/applications/create_service_spec.rb +++ b/spec/services/applications/create_service_spec.rb @@ -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 |