diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/features/projects/wiki | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/features/projects/wiki')
-rw-r--r-- | spec/features/projects/wiki/user_updates_wiki_page_spec.rb | 26 | ||||
-rw-r--r-- | spec/features/projects/wiki/user_views_wiki_pages_spec.rb | 2 |
2 files changed, 28 insertions, 0 deletions
diff --git a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb index 05d8989d88a..fdab63a56b8 100644 --- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb @@ -234,4 +234,30 @@ RSpec.describe 'User updates wiki page' do it_behaves_like 'wiki file attachments' end + + context 'when an existing page exceeds the content size limit' do + let_it_be(:project) { create(:project, :wiki_repo) } + let!(:wiki_page) { create(:wiki_page, wiki: project.wiki, content: "one\ntwo\nthree") } + + before do + stub_application_setting(wiki_page_max_content_bytes: 10) + + visit wiki_page_path(wiki_page.wiki, wiki_page, action: :edit) + end + + it 'allows changing the title if the content does not change' do + fill_in 'Title', with: 'new title' + click_on 'Save changes' + + expect(page).to have_content('Wiki was successfully updated.') + end + + it 'shows a validation error when trying to change the content' do + fill_in 'Content', with: 'new content' + click_on 'Save changes' + + expect(page).to have_content('The form contains the following error:') + expect(page).to have_content('Content is too long (11 Bytes). The maximum size is 10 Bytes.') + end + end end diff --git a/spec/features/projects/wiki/user_views_wiki_pages_spec.rb b/spec/features/projects/wiki/user_views_wiki_pages_spec.rb index fea913b8212..4f29ae0cc8a 100644 --- a/spec/features/projects/wiki/user_views_wiki_pages_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_pages_spec.rb @@ -11,9 +11,11 @@ RSpec.describe 'User views wiki pages' do let!(:wiki_page1) do create(:wiki_page, wiki: project.wiki, title: '3 home', content: '3') end + let!(:wiki_page2) do create(:wiki_page, wiki: project.wiki, title: '1 home', content: '1') end + let!(:wiki_page3) do create(:wiki_page, wiki: project.wiki, title: '2 home', content: '2') end |