diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-16 06:12:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-16 06:12:24 +0000 |
commit | 885897989971931fcb139969b49d8b06f907d7d0 (patch) | |
tree | 7c2873a6690b73d0036b56bf379634c235dfb438 /spec | |
parent | f5c9eb81b000010cf8abc91cbcfd1d6537f66c64 (diff) | |
download | gitlab-ce-885897989971931fcb139969b49d8b06f907d7d0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
18 files changed, 251 insertions, 27 deletions
diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 58d34a5e5c1..0f1501d4c3c 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -397,9 +397,10 @@ RSpec.describe SearchController do expect(payload[:metadata]['meta.search.filters.confidential']).to eq('true') expect(payload[:metadata]['meta.search.filters.state']).to eq('true') expect(payload[:metadata]['meta.search.project_ids']).to eq(%w(456 789)) + expect(payload[:metadata]['meta.search.search_level']).to eq('multi-project') end - get :show, params: { scope: 'issues', search: 'hello world', group_id: '123', project_id: '456', project_ids: %w(456 789), confidential: true, state: true, force_search_results: true } + get :show, params: { scope: 'issues', search: 'hello world', group_id: '123', project_id: '456', project_ids: %w(456 789), search_level: 'multi-project', confidential: true, state: true, force_search_results: true } end it 'appends the default scope in meta.search.scope' do diff --git a/spec/features/projects/new_project_spec.rb b/spec/features/projects/new_project_spec.rb index 51e91b76d3f..b3fbf5d356e 100644 --- a/spec/features/projects/new_project_spec.rb +++ b/spec/features/projects/new_project_spec.rb @@ -404,4 +404,47 @@ RSpec.describe 'New project', :js do end end end + + context 'from Bitbucket', :js do + shared_examples 'has a link to bitbucket cloud' do + context 'when bitbucket is not configured' do + before do + allow(Gitlab::Auth::OAuth::Provider).to receive(:enabled?).and_call_original + allow(Gitlab::Auth::OAuth::Provider) + .to receive(:enabled?).with(:bitbucket) + .and_return(false) + + visit new_project_path + click_link 'Import project' + click_link 'Bitbucket Cloud' + end + + it 'shows import instructions' do + expect(find('.modal-body')).to have_content(bitbucket_link_content) + end + end + end + + context 'as a user' do + let(:user) { create(:user) } + let(:bitbucket_link_content) { 'To enable importing projects from Bitbucket, ask your GitLab administrator to configure OAuth integration' } + + before do + sign_in(user) + end + + it_behaves_like 'has a link to bitbucket cloud' + end + + context 'as an admin' do + let(:user) { create(:admin) } + let(:bitbucket_link_content) { 'To enable importing projects from Bitbucket, as administrator you need to configure OAuth integration' } + + before do + sign_in(user) + end + + it_behaves_like 'has a link to bitbucket cloud' + end + end end diff --git a/spec/frontend/design_management/components/design_notes/design_reply_form_spec.js b/spec/frontend/design_management/components/design_notes/design_reply_form_spec.js index d2d1fe6b2d8..0cef18c60de 100644 --- a/spec/frontend/design_management/components/design_notes/design_reply_form_spec.js +++ b/spec/frontend/design_management/components/design_notes/design_reply_form_spec.js @@ -31,6 +31,10 @@ describe('Design reply form component', () => { }); } + beforeEach(() => { + gon.features = { markdownContinueLists: true }; + }); + afterEach(() => { wrapper.destroy(); }); diff --git a/spec/frontend/issues/show/components/fields/description_spec.js b/spec/frontend/issues/show/components/fields/description_spec.js index 3043c4c3673..dd511c3945c 100644 --- a/spec/frontend/issues/show/components/fields/description_spec.js +++ b/spec/frontend/issues/show/components/fields/description_spec.js @@ -25,6 +25,7 @@ describe('Description field component', () => { beforeEach(() => { jest.spyOn(eventHub, '$emit'); + gon.features = { markdownContinueLists: true }; }); afterEach(() => { diff --git a/spec/frontend/lib/utils/confirm_via_gl_modal/confirm_modal_spec.js b/spec/frontend/lib/utils/confirm_via_gl_modal/confirm_modal_spec.js index d19f9352bbc..e06d1384610 100644 --- a/spec/frontend/lib/utils/confirm_via_gl_modal/confirm_modal_spec.js +++ b/spec/frontend/lib/utils/confirm_via_gl_modal/confirm_modal_spec.js @@ -6,11 +6,13 @@ describe('Confirm Modal', () => { let wrapper; let modal; - const createComponent = ({ primaryText, primaryVariant } = {}) => { + const createComponent = ({ primaryText, primaryVariant, title, hideCancel = false } = {}) => { wrapper = mount(ConfirmModal, { propsData: { primaryText, primaryVariant, + hideCancel, + title, }, }); }; @@ -55,5 +57,19 @@ describe('Confirm Modal', () => { expect(customProps.text).toBe('OK'); expect(customProps.attributes.variant).toBe('confirm'); }); + + it('should hide the cancel button if `hideCancel` is set', () => { + createComponent({ hideCancel: true }); + const props = findGlModal().props(); + + expect(props.actionCancel).toBeNull(); + }); + + it('should set the modal title when the `title` prop is set', () => { + const title = 'Modal title'; + createComponent({ title }); + + expect(findGlModal().props().title).toBe(title); + }); }); }); diff --git a/spec/frontend/lib/utils/text_markdown_spec.js b/spec/frontend/lib/utils/text_markdown_spec.js index ab81ec47b64..dded32cc890 100644 --- a/spec/frontend/lib/utils/text_markdown_spec.js +++ b/spec/frontend/lib/utils/text_markdown_spec.js @@ -165,6 +165,80 @@ describe('init markdown', () => { // cursor placement should be between tags expect(textArea.selectionStart).toBe(start.length + tag.length); }); + + describe('Continuing markdown lists', () => { + const enterEvent = new KeyboardEvent('keydown', { key: 'Enter' }); + + beforeEach(() => { + gon.features = { markdownContinueLists: true }; + }); + + it.each` + text | expected + ${'- item'} | ${'- item\n- '} + ${'- [ ] item'} | ${'- [ ] item\n- [ ] '} + ${'- [x] item'} | ${'- [x] item\n- [x] '} + ${'- item\n - second'} | ${'- item\n - second\n - '} + ${'1. item'} | ${'1. item\n1. '} + ${'1. [ ] item'} | ${'1. [ ] item\n1. [ ] '} + ${'1. [x] item'} | ${'1. [x] item\n1. [x] '} + ${'108. item'} | ${'108. item\n108. '} + ${'108. item\n - second'} | ${'108. item\n - second\n - '} + ${'108. item\n 1. second'} | ${'108. item\n 1. second\n 1. '} + `('adds correct list continuation characters', ({ text, expected }) => { + textArea.value = text; + textArea.setSelectionRange(text.length, text.length); + + textArea.addEventListener('keydown', keypressNoteText); + textArea.dispatchEvent(enterEvent); + + expect(textArea.value).toEqual(expected); + expect(textArea.selectionStart).toBe(expected.length); + }); + + // test that when pressing Enter on an empty list item, the empty + // list item text is selected, so that when the Enter propagates, + // it's removed + it.each` + text | expected + ${'- item\n- '} | ${'- item\n'} + ${'- [ ] item\n- [ ] '} | ${'- [ ] item\n'} + ${'- [x] item\n- [x] '} | ${'- [x] item\n'} + ${'- item\n - second\n - '} | ${'- item\n - second\n'} + ${'1. item\n1. '} | ${'1. item\n'} + ${'1. [ ] item\n1. [ ] '} | ${'1. [ ] item\n'} + ${'1. [x] item\n1. [x] '} | ${'1. [x] item\n'} + ${'108. item\n108. '} | ${'108. item\n'} + ${'108. item\n - second\n - '} | ${'108. item\n - second\n'} + ${'108. item\n 1. second\n 1. '} | ${'108. item\n 1. second\n'} + `('adds correct list continuation characters', ({ text, expected }) => { + textArea.value = text; + textArea.setSelectionRange(text.length, text.length); + + textArea.addEventListener('keydown', keypressNoteText); + textArea.dispatchEvent(enterEvent); + + expect(textArea.value.substr(0, textArea.selectionStart)).toEqual(expected); + expect(textArea.selectionStart).toBe(expected.length); + expect(textArea.selectionEnd).toBe(text.length); + }); + + it('does nothing if feature flag disabled', () => { + gon.features = { markdownContinueLists: false }; + + const text = '- item'; + const expected = '- item'; + + textArea.value = text; + textArea.setSelectionRange(text.length, text.length); + + textArea.addEventListener('keydown', keypressNoteText); + textArea.dispatchEvent(enterEvent); + + expect(textArea.value).toEqual(expected); + expect(textArea.selectionStart).toBe(expected.length); + }); + }); }); describe('with selection', () => { diff --git a/spec/frontend/notes/components/note_form_spec.js b/spec/frontend/notes/components/note_form_spec.js index d3b5ab02f24..3e80b24f128 100644 --- a/spec/frontend/notes/components/note_form_spec.js +++ b/spec/frontend/notes/components/note_form_spec.js @@ -45,6 +45,8 @@ describe('issue_note_form component', () => { noteBody: 'Magni suscipit eius consectetur enim et ex et commodi.', noteId: '545', }; + + gon.features = { markdownContinueLists: true }; }); afterEach(() => { diff --git a/spec/frontend/vue_shared/issuable/show/components/issuable_edit_form_spec.js b/spec/frontend/vue_shared/issuable/show/components/issuable_edit_form_spec.js index d3e484cf913..b79dc0bf976 100644 --- a/spec/frontend/vue_shared/issuable/show/components/issuable_edit_form_spec.js +++ b/spec/frontend/vue_shared/issuable/show/components/issuable_edit_form_spec.js @@ -36,6 +36,7 @@ describe('IssuableEditForm', () => { beforeEach(() => { wrapper = createComponent(); + gon.features = { markdownContinueLists: true }; }); afterEach(() => { diff --git a/spec/frontend/zen_mode_spec.js b/spec/frontend/zen_mode_spec.js index 13f221fd9d9..44684619fae 100644 --- a/spec/frontend/zen_mode_spec.js +++ b/spec/frontend/zen_mode_spec.js @@ -45,6 +45,8 @@ describe('ZenMode', () => { // Set this manually because we can't actually scroll the window zen.scroll_position = 456; + + gon.features = { markdownContinueLists: true }; }); describe('enabling dropzone', () => { diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb index 1d78778c757..604ce0fe0c1 100644 --- a/spec/helpers/projects_helper_spec.rb +++ b/spec/helpers/projects_helper_spec.rb @@ -1026,4 +1026,26 @@ RSpec.describe ProjectsHelper do end end end + + describe '#import_from_bitbucket_message' do + before do + allow(helper).to receive(:current_user).and_return(user) + end + + context 'as a user' do + it 'returns a link to contact an administrator' do + allow(user).to receive(:admin?).and_return(false) + + expect(helper.import_from_bitbucket_message).to have_text('To enable importing projects from Bitbucket, ask your GitLab administrator to configure OAuth integration') + end + end + + context 'as an administrator' do + it 'returns a link to configure bitbucket' do + allow(user).to receive(:admin?).and_return(true) + + expect(helper.import_from_bitbucket_message).to have_text('To enable importing projects from Bitbucket, as administrator you need to configure OAuth integration') + end + end + end end diff --git a/spec/lib/gitlab/github_import/representation/diff_note_spec.rb b/spec/lib/gitlab/github_import/representation/diff_note_spec.rb index 63834cfdb94..fe3040c102b 100644 --- a/spec/lib/gitlab/github_import/representation/diff_note_spec.rb +++ b/spec/lib/gitlab/github_import/representation/diff_note_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::GithubImport::Representation::DiffNote, :clean_gitlab_redis_shared_state do +RSpec.describe Gitlab::GithubImport::Representation::DiffNote, :clean_gitlab_redis_cache do let(:hunk) do '@@ -1 +1 @@ -Hello @@ -166,6 +166,23 @@ RSpec.describe Gitlab::GithubImport::Representation::DiffNote, :clean_gitlab_red expect(new_discussion_note.discussion_id) .to eq('SECOND_DISCUSSION_ID') end + + context 'when cached value does not exist' do + it 'falls back to generating a new discussion_id' do + expect(Discussion) + .to receive(:discussion_id) + .and_return('NEW_DISCUSSION_ID') + + reply_note = described_class.from_json_hash( + 'note_id' => note.note_id + 1, + 'in_reply_to_id' => note.note_id + ) + reply_note.project = project + reply_note.merge_request = merge_request + + expect(reply_note.discussion_id).to eq('NEW_DISCUSSION_ID') + end + end end end diff --git a/spec/models/hooks/service_hook_spec.rb b/spec/models/hooks/service_hook_spec.rb index 85f433f5f81..0d65fe302e1 100644 --- a/spec/models/hooks/service_hook_spec.rb +++ b/spec/models/hooks/service_hook_spec.rb @@ -16,7 +16,7 @@ RSpec.describe ServiceHook do let(:data) { { key: 'value' } } it '#execute' do - expect(WebHookService).to receive(:new).with(hook, data, 'service_hook').and_call_original + expect(WebHookService).to receive(:new).with(hook, data, 'service_hook', force: false).and_call_original expect_any_instance_of(WebHookService).to receive(:execute) hook.execute(data) diff --git a/spec/models/hooks/system_hook_spec.rb b/spec/models/hooks/system_hook_spec.rb index 89bfb742f5d..a3d36058b74 100644 --- a/spec/models/hooks/system_hook_spec.rb +++ b/spec/models/hooks/system_hook_spec.rb @@ -168,17 +168,17 @@ RSpec.describe SystemHook do let(:data) { { key: 'value' } } let(:hook_name) { 'system_hook' } - before do - expect(WebHookService).to receive(:new).with(hook, data, hook_name).and_call_original - end - it '#execute' do + expect(WebHookService).to receive(:new).with(hook, data, hook_name, force: false).and_call_original + expect_any_instance_of(WebHookService).to receive(:execute) hook.execute(data, hook_name) end it '#async_execute' do + expect(WebHookService).to receive(:new).with(hook, data, hook_name).and_call_original + expect_any_instance_of(WebHookService).to receive(:async_execute) hook.async_execute(data, hook_name) diff --git a/spec/models/hooks/web_hook_spec.rb b/spec/models/hooks/web_hook_spec.rb index c292e78b32d..482e372543c 100644 --- a/spec/models/hooks/web_hook_spec.rb +++ b/spec/models/hooks/web_hook_spec.rb @@ -100,12 +100,18 @@ RSpec.describe WebHook do hook.execute(data, hook_name) end - it 'does not execute non-executable hooks' do - hook.update!(disabled_until: 1.day.from_now) + it 'passes force: false to the web hook service by default' do + expect(WebHookService) + .to receive(:new).with(hook, data, hook_name, force: false).and_return(double(execute: :done)) - expect(WebHookService).not_to receive(:new) + expect(hook.execute(data, hook_name)).to eq :done + end - hook.execute(data, hook_name) + it 'passes force: true to the web hook service if required' do + expect(WebHookService) + .to receive(:new).with(hook, data, hook_name, force: true).and_return(double(execute: :forced)) + + expect(hook.execute(data, hook_name, force: true)).to eq :forced end it '#async_execute' do diff --git a/spec/services/test_hooks/project_service_spec.rb b/spec/services/test_hooks/project_service_spec.rb index cd6284b4a87..d97a6f15270 100644 --- a/spec/services/test_hooks/project_service_spec.rb +++ b/spec/services/test_hooks/project_service_spec.rb @@ -37,7 +37,7 @@ RSpec.describe TestHooks::ProjectService do it 'executes hook' do allow(Gitlab::DataBuilder::Push).to receive(:build_sample).and_return(sample_data) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -49,7 +49,7 @@ RSpec.describe TestHooks::ProjectService do it 'executes hook' do allow(Gitlab::DataBuilder::Push).to receive(:build_sample).and_return(sample_data) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -69,7 +69,7 @@ RSpec.describe TestHooks::ProjectService do allow(Gitlab::DataBuilder::Note).to receive(:build).and_return(sample_data) allow_next(NotesFinder).to receive(:execute).and_return(Note.all) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -86,7 +86,7 @@ RSpec.describe TestHooks::ProjectService do allow(issue).to receive(:to_hook_data).and_return(sample_data) allow_next(IssuesFinder).to receive(:execute).and_return([issue]) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -119,7 +119,7 @@ RSpec.describe TestHooks::ProjectService do allow(merge_request).to receive(:to_hook_data).and_return(sample_data) allow_next(MergeRequestsFinder).to receive(:execute).and_return([merge_request]) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -138,7 +138,7 @@ RSpec.describe TestHooks::ProjectService do allow(Gitlab::DataBuilder::Build).to receive(:build).and_return(sample_data) allow_next(Ci::JobsFinder).to receive(:execute).and_return([ci_job]) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -157,7 +157,7 @@ RSpec.describe TestHooks::ProjectService do allow(Gitlab::DataBuilder::Pipeline).to receive(:build).and_return(sample_data) allow_next(Ci::PipelinesFinder).to receive(:execute).and_return([pipeline]) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -184,7 +184,7 @@ RSpec.describe TestHooks::ProjectService do create(:wiki_page, wiki: project.wiki) allow(Gitlab::DataBuilder::WikiPage).to receive(:build).and_return(sample_data) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -203,7 +203,7 @@ RSpec.describe TestHooks::ProjectService do allow(release).to receive(:to_hook_data).and_return(sample_data) allow_next(ReleasesFinder).to receive(:execute).and_return([release]) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end diff --git a/spec/services/test_hooks/system_service_spec.rb b/spec/services/test_hooks/system_service_spec.rb index 48c8c24212a..66a1218d123 100644 --- a/spec/services/test_hooks/system_service_spec.rb +++ b/spec/services/test_hooks/system_service_spec.rb @@ -32,7 +32,7 @@ RSpec.describe TestHooks::SystemService do it 'executes hook' do expect(Gitlab::DataBuilder::Push).to receive(:sample_data).and_call_original - expect(hook).to receive(:execute).with(Gitlab::DataBuilder::Push::SAMPLE_DATA, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(Gitlab::DataBuilder::Push::SAMPLE_DATA, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -45,7 +45,7 @@ RSpec.describe TestHooks::SystemService do allow(project.repository).to receive(:tags).and_return(['tag']) expect(Gitlab::DataBuilder::Push).to receive(:sample_data).and_call_original - expect(hook).to receive(:execute).with(Gitlab::DataBuilder::Push::SAMPLE_DATA, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(Gitlab::DataBuilder::Push::SAMPLE_DATA, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -57,7 +57,7 @@ RSpec.describe TestHooks::SystemService do it 'executes hook' do expect(Gitlab::DataBuilder::Repository).to receive(:sample_data).and_call_original - expect(hook).to receive(:execute).with(Gitlab::DataBuilder::Repository::SAMPLE_DATA, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(Gitlab::DataBuilder::Repository::SAMPLE_DATA, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end @@ -76,7 +76,7 @@ RSpec.describe TestHooks::SystemService do it 'executes hook' do expect(MergeRequest).to receive(:of_projects).and_return([merge_request]) expect(merge_request).to receive(:to_hook_data).and_return(sample_data) - expect(hook).to receive(:execute).with(sample_data, trigger_key).and_return(success_result) + expect(hook).to receive(:execute).with(sample_data, trigger_key, force: true).and_return(success_result) expect(service.execute).to include(success_result) end end diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb index 448d00076c1..64371f97908 100644 --- a/spec/services/web_hook_service_spec.rb +++ b/spec/services/web_hook_service_spec.rb @@ -52,6 +52,25 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state end end + describe '#disabled?' do + using RSpec::Parameterized::TableSyntax + + subject { described_class.new(hook, data, :push_hooks, force: forced) } + + let(:hook) { double(executable?: executable, allow_local_requests?: false) } + + where(:forced, :executable, :disabled) do + false | true | false + false | false | true + true | true | false + true | false | false + end + + with_them do + it { is_expected.to have_attributes(disabled?: disabled) } + end + end + describe '#execute' do let!(:uuid) { SecureRandom.uuid } let(:headers) do @@ -129,7 +148,7 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state end it 'does not execute disabled hooks' do - project_hook.update!(recent_failures: 4) + allow(service_instance).to receive(:disabled?).and_return(true) expect(service_instance.execute).to eq({ status: :error, message: 'Hook disabled' }) end @@ -251,6 +270,20 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state stub_full_request(project_hook.url, method: :post).to_return(status: 200, body: 'Success') end + context 'when forced' do + let(:service_instance) { described_class.new(project_hook, data, :push_hooks, force: true) } + + it 'logs execution inline' do + expect(::WebHooks::LogExecutionWorker).not_to receive(:perform_async) + expect(::WebHooks::LogExecutionService) + .to receive(:new) + .with(hook: project_hook, log_data: Hash, response_category: :ok) + .and_return(double(execute: nil)) + + run_service + end + end + it 'log successful execution' do run_service diff --git a/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb index 1a981f42086..2285d9a17e2 100644 --- a/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb @@ -85,7 +85,9 @@ RSpec.shared_examples 'User previews wiki changes' do end it 'renders content with CommonMark' do - fill_in :wiki_content, with: "1. one\n - sublist\n" + # using two `\n` ensures we're sublist to it's own line due + # to list auto-continue + fill_in :wiki_content, with: "1. one\n\n - sublist\n" click_on "Preview" # the above generates two separate lists (not embedded) in CommonMark |