From 72b7b10d52de1b150b124c017427b2802b4193e6 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 24 Oct 2017 09:38:06 +0300 Subject: add applications controller logic --- spec/services/applications/create_service_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 spec/services/applications/create_service_spec.rb (limited to 'spec') diff --git a/spec/services/applications/create_service_spec.rb b/spec/services/applications/create_service_spec.rb new file mode 100644 index 00000000000..0bd96a605c0 --- /dev/null +++ b/spec/services/applications/create_service_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe ::Applications::CreateService do + let(:user) { create(:user) } + let(:params) { attributes_for(:application) } + + subject { described_class.new(user, params) } + + it 'creates an application' do + expect { subject.execute }.to change { Doorkeeper::Application.count }.by(1) + end +end -- cgit v1.2.1 From 37eb00ce5b684ff2bbbc83746a298a71e275c84d Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 2 Nov 2017 08:49:36 +0100 Subject: fix specs --- spec/services/applications/create_service_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/services/applications/create_service_spec.rb b/spec/services/applications/create_service_spec.rb index 0bd96a605c0..47a2a9d6403 100644 --- a/spec/services/applications/create_service_spec.rb +++ b/spec/services/applications/create_service_spec.rb @@ -3,10 +3,11 @@ 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') } subject { described_class.new(user, params) } 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 -- cgit v1.2.1