Skip to content

Commit 50a857a

Browse files
committed
More spec fixes
1 parent 8605b87 commit 50a857a

7 files changed

Lines changed: 10 additions & 31 deletions

File tree

app/models/project.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def project
232232
end
233233

234234
def wiki
235-
super&.enabled ? super : nil
235+
super&.enabled and super
236236
end
237237

238238
def <=>(other)

app/seeders/demo_data/wiki_seeder.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ def initialize(project, project_data)
3737
end
3838

3939
def seed_data!
40-
create_project_wiki!
41-
4240
text = project_data.lookup("wiki")
43-
4441
return if text.blank?
4542

43+
create_project_wiki!
44+
4645
if text.is_a? String
4746
text = [{ title: "Wiki", content: text }]
4847
end

modules/bim/app/seeders/bim.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ projects:
244244
- work_package_tracking
245245
- gantt
246246
- news
247-
- wiki
248247
- board_view
249248
- team_planner_view
250249
- documents
@@ -393,7 +392,6 @@ projects:
393392
- work_package_tracking
394393
- gantt
395394
- news
396-
- wiki
397395
- board_view
398396
- team_planner_view
399397
- documents
@@ -875,7 +873,6 @@ projects:
875873
- work_package_tracking
876874
- gantt
877875
- news
878-
- wiki
879876
- board_view
880877
- team_planner_view
881878
news:

modules/bim/app/seeders/bim/basic_data_seeder.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def data_seeder_classes
4545
::BasicData::PrioritySeeder,
4646
::Bim::BasicData::SettingSeeder,
4747
::Bim::BasicData::ThemeSeeder
48+
4849
]
4950
end
5051
end

modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ def group_name(reference)
5353

5454
it "creates the BIM demo data" do
5555
expect(Project.count).to eq 4
56-
expect(EnabledModule.count).to eq 29
56+
expect(EnabledModule.count).to eq 26
5757
expect(WorkPackage.count).to eq 76
58-
expect(Wiki.count).to eq 3
58+
expect(Wiki.count).to eq 0
5959
expect(Query.count).to eq 29
6060
expect(Group.count).to eq 8
6161
expect(Type.count).to eq 7
@@ -138,7 +138,7 @@ def group_name(reference)
138138
it "does not create additional data and does not raise any errors" do
139139
expect(Project.count).to eq 4
140140
expect(WorkPackage.count).to eq 76
141-
expect(Wiki.count).to eq 3
141+
expect(Wiki.count).to eq 0
142142
expect(Query.count).to eq 29
143143
expect(Group.count).to eq 8
144144
expect(Type.count).to eq 7

spec/models/project_spec.rb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -133,25 +133,6 @@
133133
end
134134
end
135135

136-
context "when the wiki module is enabled" do
137-
let(:project) { create(:project, disable_modules: "wiki") }
138-
139-
before do
140-
project.enabled_module_names = project.enabled_module_names | ["wiki"]
141-
project.save
142-
project.reload
143-
end
144-
145-
it "creates a wiki" do
146-
expect(project.wiki).to be_present
147-
end
148-
149-
it "creates a wiki menu item named like the default start page" do
150-
expect(project.wiki.wiki_menu_items).to be_one
151-
expect(project.wiki.wiki_menu_items.first.title).to eq(project.wiki.start_page)
152-
end
153-
end
154-
155136
describe "#copy_allowed?" do
156137
let(:user) { build_stubbed(:user) }
157138
let(:project) { build_stubbed(:project) }

spec/requests/api/v3/projects/copy/copy_resource_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343

4444
shared_let(:source_project) do
4545
create(:project,
46-
enabled_module_names: %w[work_package_tracking wiki],
46+
:with_internal_wiki,
47+
enabled_module_names: %w[work_package_tracking],
4748
custom_field_values: {
4849
text_custom_field.id => "source text",
4950
list_custom_field.id => list_custom_field.custom_options.last.id
@@ -158,7 +159,7 @@
158159
expect(project).to be_present
159160

160161
expect(source_project.wiki.pages.count).to eq 1
161-
expect(project.wiki.pages.count).to eq 0
162+
expect(project.wiki).to be_nil
162163

163164
expect(source_project.work_packages.count).to eq 1
164165
expect(project.work_packages.count).to eq 1

0 commit comments

Comments
 (0)