summaryrefslogtreecommitdiff
path: root/spec/services/merge_requests/push_options_handler_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/merge_requests/push_options_handler_service_spec.rb')
-rw-r--r--spec/services/merge_requests/push_options_handler_service_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/merge_requests/push_options_handler_service_spec.rb b/spec/services/merge_requests/push_options_handler_service_spec.rb
index 391377ad801..251bf6f0d9d 100644
--- a/spec/services/merge_requests/push_options_handler_service_spec.rb
+++ b/spec/services/merge_requests/push_options_handler_service_spec.rb
@@ -730,6 +730,15 @@ RSpec.describe MergeRequests::PushOptionsHandlerService do
it_behaves_like 'with a deleted branch'
it_behaves_like 'with the project default branch'
+
+ context 'when passing in usernames' do
+ # makes sure that usernames starting with numbers aren't treated as IDs
+ let(:user2) { create(:user, username: '123user', developer_projects: [project]) }
+ let(:user3) { create(:user, username: '999user', developer_projects: [project]) }
+ let(:assigned) { { user2.username => 1, user3.username => 1 } }
+
+ it_behaves_like 'with an existing branch that has a merge request open in foss'
+ end
end
describe '`unassign` push option' do
@@ -743,6 +752,13 @@ RSpec.describe MergeRequests::PushOptionsHandlerService do
it_behaves_like 'with a deleted branch'
it_behaves_like 'with the project default branch'
+
+ context 'when passing in usernames' do
+ let(:assigned) { { user2.username => 1, user3.username => 1 } }
+ let(:unassigned) { { user1.username => 1, user3.username => 1 } }
+
+ it_behaves_like 'with an existing branch that has a merge request open in foss'
+ end
end
describe 'multiple pushed branches' do