summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-09 00:24:46 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-09 00:24:46 -0800
commitf8f76fdbfd06184c53c4dc3832601f3c07aeba77 (patch)
tree6c15edae1c35296907230206f3431989a0678246 /spec/controllers
parenta10c08c4c75ea2753b092e66b1daed7ffe23a0b6 (diff)
parentb89d8497f6bf911a74c350dfce6256c2a08ef59b (diff)
downloadgitlab-ce-f8f76fdbfd06184c53c4dc3832601f3c07aeba77.tar.gz
Merge pull request #5427 from karlhungus/feature_search_code_in_public_repos
Allow public repo searching
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/search_controller_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb
new file mode 100644
index 00000000000..8742789a3b1
--- /dev/null
+++ b/spec/controllers/search_controller_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+describe SearchController do
+ let(:project) { create(:project, public: true) }
+ let(:user) { create(:user) }
+
+ before do
+ sign_in(user)
+ end
+
+ describe '#find_project_ids' do
+ it 'should include public projects ids when searching within a single project' do
+ project_ids = controller.send(:find_project_ids,nil, project.id)
+ project_ids.size.should == 1
+ project_ids[0].should == project.id
+ end
+ end
+end