Commit 83d02a0b authored by Shinya Maeda's avatar Shinya Maeda

Change name to username

parent a46c91f4
...@@ -81,7 +81,7 @@ class PipelinesFinder ...@@ -81,7 +81,7 @@ class PipelinesFinder
def by_username(items) def by_username(items)
if params[:username].present? if params[:username].present?
items.joins(:user).where("users.name = ?", params[:username]) items.joins(:user).where("users.username = ?", params[:username])
else else
items items
end end
......
...@@ -144,7 +144,7 @@ describe PipelinesFinder do ...@@ -144,7 +144,7 @@ describe PipelinesFinder do
context 'when a username is passed' do context 'when a username is passed' do
context 'when a username exists' do context 'when a username exists' do
let(:params) { { username: user1.name } } let(:params) { { username: user1.username } }
it 'selects all pipelines which belong to the username' do it 'selects all pipelines which belong to the username' do
expect(subject).to match_array(Ci::Pipeline.where(user: user1)) expect(subject).to match_array(Ci::Pipeline.where(user: user1))
......
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