Commit 5c2f3eed authored by Huzaifa Iftikhar's avatar Huzaifa Iftikhar Committed by Matthias Käppler

Fix Rails/SaveBang Rubocop offenses for wiki_page models

parent c765eb69
...@@ -575,6 +575,9 @@ Rails/SaveBang: ...@@ -575,6 +575,9 @@ Rails/SaveBang:
- 'ee/spec/**/*.rb' - 'ee/spec/**/*.rb'
- 'qa/spec/**/*.rb' - 'qa/spec/**/*.rb'
- 'qa/qa/specs/**/*.rb' - 'qa/qa/specs/**/*.rb'
Exclude:
- spec/models/wiki_page/**/*
- spec/models/wiki_page_spec.rb
Cop/PutProjectRoutesUnderScope: Cop/PutProjectRoutesUnderScope:
Include: Include:
......
...@@ -245,8 +245,6 @@ Rails/SaveBang: ...@@ -245,8 +245,6 @@ Rails/SaveBang:
- 'spec/models/user_preference_spec.rb' - 'spec/models/user_preference_spec.rb'
- 'spec/models/user_spec.rb' - 'spec/models/user_spec.rb'
- 'spec/models/user_status_spec.rb' - 'spec/models/user_status_spec.rb'
- 'spec/models/wiki_page/meta_spec.rb'
- 'spec/models/wiki_page_spec.rb'
Rails/TimeZone: Rails/TimeZone:
Enabled: true Enabled: true
......
---
title: Fix Rails/SaveBang Rubocop offenses for wiki_page models
merge_request: 57899
author: Huzaifa Iftikhar @huzaifaiftikhar
type: fixed
...@@ -42,7 +42,7 @@ RSpec.describe WikiPage::Meta do ...@@ -42,7 +42,7 @@ RSpec.describe WikiPage::Meta do
subject { described_class.find(meta.id) } subject { described_class.find(meta.id) }
let_it_be(:meta) do let_it_be(:meta) do
described_class.create(title: generate(:wiki_page_title), project: project) described_class.create!(title: generate(:wiki_page_title), project: project)
end end
context 'there are no slugs' do context 'there are no slugs' do
...@@ -183,7 +183,7 @@ RSpec.describe WikiPage::Meta do ...@@ -183,7 +183,7 @@ RSpec.describe WikiPage::Meta do
# an old slug that = canonical_slug # an old slug that = canonical_slug
different_slug = generate(:sluggified_title) different_slug = generate(:sluggified_title)
create(:wiki_page_meta, project: project, canonical_slug: different_slug) create(:wiki_page_meta, project: project, canonical_slug: different_slug)
.slugs.create(slug: wiki_page.slug) .slugs.create!(slug: wiki_page.slug)
end end
shared_examples 'metadata examples' do shared_examples 'metadata examples' do
......
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