diff options
author | Robert Speicher <robert@gitlab.com> | 2017-02-06 17:00:46 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-02-06 17:00:46 +0000 |
commit | b0f5d1a9b90645274f78c6d497871f382ed90eb0 (patch) | |
tree | 4c4104bc75a96a6961e7c2a21306e168cf76b03c /spec/models | |
parent | 7c8033e025d3b9e35be1e0ce2e3747319d5cb915 (diff) | |
parent | 3deb66ea569cde62c3213b2671532c0db3c7263d (diff) | |
download | gitlab-ce-b0f5d1a9b90645274f78c6d497871f382ed90eb0.tar.gz |
Merge branch 'traits-for-featurs' into 'master'
Add traits for ProjectFeatures to Project factory
Closes #24007
See merge request !8925
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ability_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/guest_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_feature_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 2 |
5 files changed, 3 insertions, 7 deletions
diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb index 2f4a33a1868..30f8fdf91b2 100644 --- a/spec/models/ability_spec.rb +++ b/spec/models/ability_spec.rb @@ -247,7 +247,7 @@ describe Ability, lib: true do end describe '.project_disabled_features_rules' do - let(:project) { create(:empty_project, wiki_access_level: ProjectFeature::DISABLED) } + let(:project) { create(:empty_project, :wiki_disabled) } subject { described_class.allowed(project.owner, project) } diff --git a/spec/models/guest_spec.rb b/spec/models/guest_spec.rb index 582b54c0712..c60bd7af958 100644 --- a/spec/models/guest_spec.rb +++ b/spec/models/guest_spec.rb @@ -37,8 +37,6 @@ describe Guest, lib: true do context 'when repository is enabled' do it 'allows to pull the repo' do - public_project.project_feature.update_attribute(:repository_access_level, ProjectFeature::ENABLED) - expect(Guest.can?(:download_code, public_project)).to eq(true) end end diff --git a/spec/models/project_feature_spec.rb b/spec/models/project_feature_spec.rb index 8589f1eb712..09a4448d387 100644 --- a/spec/models/project_feature_spec.rb +++ b/spec/models/project_feature_spec.rb @@ -57,7 +57,6 @@ describe ProjectFeature do context 'when feature is enabled for everyone' do it "returns true" do features.each do |feature| - project.project_feature.update_attribute("#{feature}_access_level".to_sym, ProjectFeature::ENABLED) expect(project.feature_available?(:issues, user)).to eq(true) end end @@ -104,7 +103,6 @@ describe ProjectFeature do it "returns true when feature is enabled for everyone" do features.each do |feature| - project.project_feature.update_attribute("#{feature}_access_level".to_sym, ProjectFeature::ENABLED) expect(project.public_send("#{feature}_enabled?")).to eq(true) end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 48b085781e7..264a5b04a26 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -632,7 +632,7 @@ describe Project, models: true do end describe '#has_wiki?' do - let(:no_wiki_project) { create(:empty_project, wiki_access_level: ProjectFeature::DISABLED, has_external_wiki: false) } + let(:no_wiki_project) { create(:empty_project, :wiki_disabled, has_external_wiki: false) } let(:wiki_enabled_project) { create(:empty_project) } let(:external_wiki_project) { create(:empty_project, has_external_wiki: true) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 6d58b1455c4..6c4c82cef53 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1232,7 +1232,7 @@ describe User, models: true do end it 'does not include projects for which issues are disabled' do - project = create(:empty_project, issues_access_level: ProjectFeature::DISABLED) + project = create(:empty_project, :issues_disabled) expect(user.projects_where_can_admin_issues.to_a).to be_empty expect(user.can?(:admin_issue, project)).to eq(false) |