Skip to content
Snippets Groups Projects

Make getting a user by the username case insensitive

Merged William George requested to merge awgeorge1/gitlab-ce:master into master
All threads resolved!
Compare and Show latest version
1 file
+ 5
5
Compare changes
  • Side-by-side
  • Inline
@@ -114,7 +114,7 @@
context 'when passing a non existing username to the id' do
it 'raises ActiveRecord::RecordNotFound' do
found = described_class.new("non_existent_username")
finder = described_class.new("non_existent_username")
expect { finder.find_by_id! }.to raise_error(ActiveRecord::RecordNotFound)
end
@@ -122,7 +122,7 @@
context 'when passing an existing username to the id' do
it 'raises ActiveRecord::RecordNotFound' do
found = described_class.new(user.username)
finder = described_class.new(user.username)
expect { finder.find_by_id! }.to raise_error(ActiveRecord::RecordNotFound)
end
@@ -130,7 +130,7 @@
context 'when passing a non existing id to the username' do
it 'raises ActiveRecord::RecordNotFound' do
found = described_class.new(1)
finder = described_class.new(1)
expect { finder.find_by_username! }.to raise_error(ActiveRecord::RecordNotFound)
end
@@ -138,7 +138,7 @@
context 'when passing an existing id to the username' do
it 'raises ActiveRecord::RecordNotFound' do
found = described_class.new(user.id)
finder = described_class.new(user.id)
expect { finder.find_by_username! }.to raise_error(ActiveRecord::RecordNotFound)
end
@@ -146,7 +146,7 @@
context 'when passing an existing id (as string) to the username' do
it 'raises ActiveRecord::RecordNotFound' do
found = described_class.new(user.id.to_s)
finder = described_class.new(user.id.to_s)
expect { finder.find_by_username! }.to raise_error(ActiveRecord::RecordNotFound)
end
Loading