Created
April 25, 2011 10:14
-
-
Save freegenie/940335 to your computer and use it in GitHub Desktop.
search_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Network::SearchController do | |
before do | |
request.env['HTTPS'] = 'on' | |
end | |
describe '#global' do | |
context 'anonymously' do | |
before do | |
end | |
it 'should find in searchable projects' do | |
results = mock_search_results_for([]) | |
Project.should_receive(:search) do |term, options| | |
options[:with][:searchable].should == true | |
results | |
end | |
Asset.stubs(:search => results) | |
User.stubs(:search => results) | |
get :global, {:q => 'search'} | |
end | |
it 'should find public and restricted projects' do | |
results = mock_search_results_for([]) | |
Project.should_receive(:search) do |term, options| | |
options[:with][:kind].should == [0,1] | |
results | |
end | |
Asset.stubs(:search => results) | |
User.stubs(:search => results) | |
get :global, {:q => 'search'} | |
end | |
it 'should find in searchable assets' do | |
pending | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment