summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-07-12 18:45:16 +0100
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-07-12 18:45:16 +0100
commit770d2831f8c69c8f485092fadc37a017acda8fcc (patch)
treee1b851d105b794712d20ef3d45ddea8199b9a199
parent3e44aac08dc744915b932a0a7bed0d3f3ab3ab6b (diff)
downloadgitlab-ce-770d2831f8c69c8f485092fadc37a017acda8fcc.tar.gz
fixes test for simplified version of project
-rw-r--r--app/controllers/concerns/filter_branches.rb8
-rw-r--r--spec/requests/api/projects_spec.rb2
2 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/concerns/filter_branches.rb b/app/controllers/concerns/filter_branches.rb
new file mode 100644
index 00000000000..5376a514e19
--- /dev/null
+++ b/app/controllers/concerns/filter_branches.rb
@@ -0,0 +1,8 @@
+module FilterBranches
+ extend ActiveSupport::Concern
+
+ def filter_branches(branches)
+ if params[:search].present? && @sort
+ branches = @repository.find_similar_branches(params[:search], @sort)
+ end
+end
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index d7c0f60048b..4ddab08ef14 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -83,7 +83,7 @@ describe API::API, api: true do
context 'GET /projects?simple=true' do
it 'should return a simplified version of all the projects' do
- expected_keys = ["id", "http_url_to_repo", "web_url", "name", "name_with_namespace", "path", "path_with_namespace", "permissions"]
+ expected_keys = ["id", "http_url_to_repo", "web_url", "name", "name_with_namespace", "path", "path_with_namespace"]
get api('/projects?simple=true', user)
expect(response).to have_http_status(200)