From 83d02a0b609ea71ef8448b9012221962dda69aba Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 8 Mar 2017 18:19:11 +0900 Subject: [PATCH] Change name to username --- app/finders/pipelines_finder.rb | 2 +- spec/finders/pipelines_finder_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/finders/pipelines_finder.rb b/app/finders/pipelines_finder.rb index aa0210fa7f2..c01a1a73666 100644 --- a/app/finders/pipelines_finder.rb +++ b/app/finders/pipelines_finder.rb @@ -81,7 +81,7 @@ class PipelinesFinder def by_username(items) if params[:username].present? - items.joins(:user).where("users.name = ?", params[:username]) + items.joins(:user).where("users.username = ?", params[:username]) else items end diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb index aa8ad66cdf4..3a840eca44f 100644 --- a/spec/finders/pipelines_finder_spec.rb +++ b/spec/finders/pipelines_finder_spec.rb @@ -144,7 +144,7 @@ describe PipelinesFinder do context 'when a username is passed' 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 expect(subject).to match_array(Ci::Pipeline.where(user: user1))