diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-10-15 01:38:41 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-10-20 01:00:52 +0300 |
commit | ed9838cd292ce78ae98079f513d0d1648b7f49f0 (patch) | |
tree | 463609b32b527610781e68045e13628df97e30df /spec/models | |
parent | c08435e3c25f0a7a705ed8a49b16dde176b41a40 (diff) |
Create project feature when project is created
Diffstat (limited to 'spec/models')
-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 |