Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/user_callouts_controller_spec.rb')
-rw-r--r--spec/controllers/user_callouts_controller_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/controllers/user_callouts_controller_spec.rb b/spec/controllers/user_callouts_controller_spec.rb
index 279f825e40f..3bb8d78a6b0 100644
--- a/spec/controllers/user_callouts_controller_spec.rb
+++ b/spec/controllers/user_callouts_controller_spec.rb
@@ -3,14 +3,16 @@
require 'spec_helper'
RSpec.describe UserCalloutsController do
- let(:user) { create(:user) }
+ let_it_be(:user) { create(:user) }
before do
sign_in(user)
end
describe "POST #create" do
- subject { post :create, params: { feature_name: feature_name }, format: :json }
+ let(:params) { { feature_name: feature_name } }
+
+ subject { post :create, params: params, format: :json }
context 'with valid feature name' do
let(:feature_name) { UserCallout.feature_names.each_key.first }
@@ -30,9 +32,8 @@ RSpec.describe UserCalloutsController do
context 'when callout entry already exists' do
let!(:callout) { create(:user_callout, feature_name: UserCallout.feature_names.each_key.first, user: user) }
- it 'returns success' do
- subject
-
+ it 'returns success', :aggregate_failures do
+ expect { subject }.not_to change { UserCallout.count }
expect(response).to have_gitlab_http_status(:ok)
end
end