diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/features/snippets/user_edits_snippet_spec.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/features/snippets/user_edits_snippet_spec.rb')
-rw-r--r-- | spec/features/snippets/user_edits_snippet_spec.rb | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/spec/features/snippets/user_edits_snippet_spec.rb b/spec/features/snippets/user_edits_snippet_spec.rb index b4f8fbfa47e..40b0113cf39 100644 --- a/spec/features/snippets/user_edits_snippet_spec.rb +++ b/spec/features/snippets/user_edits_snippet_spec.rb @@ -10,12 +10,9 @@ describe 'User edits snippet', :js do let_it_be(:user) { create(:user) } let_it_be(:snippet, reload: true) { create(:personal_snippet, :repository, :public, file_name: file_name, content: content, author: user) } - let(:version_snippet_enabled) { true } - before do stub_feature_flags(snippets_vue: false) stub_feature_flags(snippets_edit_vue: false) - stub_feature_flags(version_snippets: version_snippet_enabled) sign_in(user) @@ -33,18 +30,6 @@ describe 'User edits snippet', :js do end end - context 'when feature flag :version_snippets is disabled' do - let(:version_snippet_enabled) { false } - - it 'displays the snippet file_name and content' do - aggregate_failures do - expect(page.find_field('personal_snippet_file_name').value).to eq file_name - expect(page.find('.file-content')).to have_content(content) - expect(page.find('.snippet-file-content', visible: false).value).to eq content - end - end - end - it 'updates the snippet' do fill_in 'personal_snippet_title', with: 'New Snippet Title' @@ -88,16 +73,17 @@ describe 'User edits snippet', :js do context 'when the git operation fails' do before do allow_next_instance_of(Snippets::UpdateService) do |instance| - allow(instance).to receive(:create_commit).and_raise(StandardError) + allow(instance).to receive(:create_commit).and_raise(StandardError, 'Error Message') end fill_in 'personal_snippet_title', with: 'New Snippet Title' + fill_in 'personal_snippet_file_name', with: 'new_file_name' click_button('Save changes') end it 'renders edit page and displays the error' do - expect(page.find('.flash-container span').text).to eq('Error updating the snippet') + expect(page.find('.flash-container span').text).to eq('Error updating the snippet - Error Message') expect(page).to have_content('Edit Snippet') end end |