Commit a5af4590 authored by Valery Sizov's avatar Valery Sizov

Fix gitlab:elastic:index_wiki

parent 3b5f3c61
......@@ -239,7 +239,7 @@ class Project < ActiveRecord::Base
scope :with_builds_enabled, -> { with_feature_enabled(:builds) }
scope :with_issues_enabled, -> { with_feature_enabled(:issues) }
scope :with_wiki_enabled, -> { with_project_feature(:wiki) }
scope :with_wiki_enabled, -> { with_feature_enabled(:wiki) }
# project features may be "disabled", "internal" or "enabled". If "internal",
# they are only available to team members. This scope returns projects where
......
......@@ -118,6 +118,18 @@ describe Project, models: true do
it { is_expected.to include_module(Sortable) }
end
describe 'scopes' do
context '#with_wiki_enabled' do
it 'returns a project' do
project = create(:project_empty_repo, wiki_access_level: ProjectFeature::ENABLED)
project1 = create(:project, wiki_access_level: ProjectFeature::DISABLED)
expect(Project.with_wiki_enabled).to include(project)
expect(Project.with_wiki_enabled).not_to include(project1)
end
end
end
describe 'validation' do
let!(:project) { create(:project) }
......
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