Commit 11e8df41 authored by Małgorzata Ksionek's avatar Małgorzata Ksionek

Lower spec bar for number of sql queries

parent a6ae996d
......@@ -1870,9 +1870,10 @@ class User < ApplicationRecord
end
def password_expired_if_applicable?
return false unless password_expired?
return false unless allow_password_authentication?
password_expired?
true
end
def can_be_deactivated?
......
......@@ -68,7 +68,7 @@ RSpec.describe 'Setting assignees of a merge request', :assume_throttled do
context 'when the current user does not have permission to add assignees' do
let(:current_user) { create(:user) }
let(:db_query_limit) { 28 }
let(:db_query_limit) { 27 }
it 'does not change the assignees' do
project.add_guest(current_user)
......@@ -80,7 +80,7 @@ RSpec.describe 'Setting assignees of a merge request', :assume_throttled do
end
context 'with assignees already assigned' do
let(:db_query_limit) { 46 }
let(:db_query_limit) { 39 }
before do
merge_request.assignees = [assignee2]
......@@ -96,7 +96,7 @@ RSpec.describe 'Setting assignees of a merge request', :assume_throttled do
end
context 'when passing an empty list of assignees' do
let(:db_query_limit) { 32 }
let(:db_query_limit) { 31 }
let(:input) { { assignee_usernames: [] } }
before do
......@@ -115,7 +115,7 @@ RSpec.describe 'Setting assignees of a merge request', :assume_throttled do
context 'when passing append as true' do
let(:mode) { Types::MutationOperationModeEnum.enum[:append] }
let(:input) { { assignee_usernames: [assignee2.username], operation_mode: mode } }
let(:db_query_limit) { 22 }
let(:db_query_limit) { 21 }
before do
# In CE, APPEND is a NOOP as you can't have multiple assignees
......@@ -135,7 +135,7 @@ RSpec.describe 'Setting assignees of a merge request', :assume_throttled do
end
context 'when passing remove as true' do
let(:db_query_limit) { 32 }
let(:db_query_limit) { 31 }
let(:mode) { Types::MutationOperationModeEnum.enum[:remove] }
let(:input) { { assignee_usernames: [assignee.username], operation_mode: mode } }
let(:expected_result) { [] }
......
......@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe API::ImportBitbucketServer do
let(:base_uri) { "https://test:7990" }
let(:user) { create(:user, bio: 'test') }
let(:user) { create(:user) }
let(:token) { "asdasd12345" }
let(:secret) { "sekrettt" }
let(:project_key) { 'TES' }
......
......@@ -76,7 +76,7 @@ RSpec.describe Repositories::ChangelogService do
recorder = ActiveRecord::QueryRecorder.new { service.execute }
changelog = project.repository.blob_at('master', 'CHANGELOG.md')&.data
expect(recorder.count).to eq(12)
expect(recorder.count).to eq(11)
expect(changelog).to include('Title 1', 'Title 2')
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment