Commit c0d9cbfd authored by Hannes Rosenögger's avatar Hannes Rosenögger

Merge branch 'add-test-for-project-search-results' into 'master'

Add init test for ProjectSearchResults

Regression test for: https://github.com/gitlabhq/gitlabhq/pull/9368

See merge request !788
parents db915f7a 62079d76
require 'spec_helper'
describe Gitlab::ProjectSearchResults do
let(:project) { create(:project) }
let(:query) { 'hello world' }
describe 'initialize with empty ref' do
let(:results) { Gitlab::ProjectSearchResults.new(project.id, query, '') }
it { expect(results.project).to eq(project) }
it { expect(results.repository_ref).to be_nil }
it { expect(results.query).to eq('hello\\ world') }
end
describe 'initialize with ref' do
let(:ref) { 'refs/heads/test' }
let(:results) { Gitlab::ProjectSearchResults.new(project.id, query, ref) }
it { expect(results.project).to eq(project) }
it { expect(results.repository_ref).to eq(ref) }
it { expect(results.query).to eq('hello\\ world') }
end
end
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