このコミットが含まれているのは:
@@ -9,7 +9,7 @@ RSpec.describe 'Wiki title collision', type: :request do
|
||||
end
|
||||
|
||||
def create_wiki_page title:, body:
|
||||
seed_wiki_page(
|
||||
seed_description(
|
||||
tag_name: create(:tag_name, name: title),
|
||||
body:,
|
||||
created_by_user: user,
|
||||
@@ -20,9 +20,9 @@ RSpec.describe 'Wiki title collision', type: :request do
|
||||
source = create_wiki_page(title: 'wiki_collision_source', body: 'source body')
|
||||
create_wiki_page(title: 'wiki_collision_target', body: 'target body')
|
||||
|
||||
source_revision_count = source.wiki_revisions.count
|
||||
source_version_count = source.wiki_versions.count
|
||||
old_title = source.title
|
||||
source_revision_count = description_versions(source).count
|
||||
source_version_count = description_versions(source).count
|
||||
old_title = source.tag.reload.name('ja')
|
||||
old_body = source.body
|
||||
|
||||
put "/wiki/#{ source.id }",
|
||||
@@ -30,7 +30,7 @@ RSpec.describe 'Wiki title collision', type: :request do
|
||||
title: 'wiki_collision_target',
|
||||
body: 'new body',
|
||||
message: 'rename collision',
|
||||
base_revision_id: source.current_revision.id,
|
||||
base_revision_id: current_description_version(source).id,
|
||||
},
|
||||
headers: auth_headers(user)
|
||||
|
||||
@@ -38,10 +38,10 @@ RSpec.describe 'Wiki title collision', type: :request do
|
||||
|
||||
source.reload
|
||||
|
||||
expect(source.title).to eq(old_title)
|
||||
expect(source.tag.reload.name('ja')).to eq(old_title)
|
||||
expect(source.body).to eq(old_body)
|
||||
expect(source.wiki_revisions.count).to eq(source_revision_count)
|
||||
expect(source.wiki_versions.count).to eq(source_version_count)
|
||||
expect(description_versions(source).count).to eq(source_revision_count)
|
||||
expect(description_versions(source).count).to eq(source_version_count)
|
||||
end
|
||||
|
||||
it 'rejects frozen creation with an existing title without adding history' do
|
||||
@@ -52,9 +52,8 @@ RSpec.describe 'Wiki title collision', type: :request do
|
||||
params: { title: 'Help:wiki_collision_create', body: 'new body',
|
||||
message: 'duplicate create' },
|
||||
headers: auth_headers(user)
|
||||
end.to change(WikiPage, :count).by(0)
|
||||
.and change(WikiRevision, :count).by(0)
|
||||
.and change(WikiVersion, :count).by(0)
|
||||
end.to change(TagDescription, :count).by(0)
|
||||
.and change(TagDescriptionVersion, :count).by(0)
|
||||
|
||||
expect(response.status).to be_between(400, 499)
|
||||
end
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする