diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-10-20 13:57:33 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-20 17:55:22 +0300 |
commit | 09fc48ac19580e862f506db7a4d8ba0c327d3567 (patch) | |
tree | 501d3092dbfbc84d5b27fcd6f130ede4476f0035 /spec | |
parent | 428bc2a5ae56ac3f61c458352b1a01c0687cf08e (diff) |
Merge branch 'issue_22944' into 'master'
Create project feature when project is created
closes #22944
See merge request !6908
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/project_spec.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index e6d98e25d0b..f4dda1ee558 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -67,6 +67,14 @@ describe Project, models: true do it { is_expected.to have_many(:notification_settings).dependent(:destroy) } it { is_expected.to have_many(:forks).through(:forked_project_links) } + context 'after create' do + it "creates project feature" do + project = FactoryGirl.build(:project) + + expect { project.save }.to change{ project.project_feature.present? }.from(false).to(true) + end + end + describe '#members & #requesters' do let(:project) { create(:project, :public) } let(:requester) { create(:user) } @@ -531,9 +539,9 @@ describe Project, models: true do end describe '#has_wiki?' do - let(:no_wiki_project) { build(:project, wiki_enabled: false, has_external_wiki: false) } - let(:wiki_enabled_project) { build(:project) } - let(:external_wiki_project) { build(:project, has_external_wiki: true) } + let(:no_wiki_project) { create(:project, wiki_access_level: ProjectFeature::DISABLED, has_external_wiki: false) } + let(:wiki_enabled_project) { create(:project) } + let(:external_wiki_project) { create(:project, has_external_wiki: true) } it 'returns true if project is wiki enabled or has external wiki' do expect(wiki_enabled_project).to have_wiki |