diff options
author | Rémy Coutable <remy@rymai.me> | 2017-07-05 18:04:05 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-05 18:04:05 +0300 |
commit | d9a5d9214002a2895aaf0c598bef985b2b4ddc57 (patch) | |
tree | 7860a16b315f175a1476c3650bdadfcf53f0a43d /features/steps | |
parent | 45ee128e9c203b02dd7d68da2d9caeaf8a0cf02d (diff) | |
parent | 9651521ea7f1cd4d77f7ab11359d8b0075b52fa6 (diff) |
Merge branch '23036-replace-snippets-spinach' into 'master'
Replace 'snippets/snippets.feature' spinach with rspec
See merge request !12385
Diffstat (limited to 'features/steps')
-rw-r--r-- | features/steps/shared/paths.rb | 4 | ||||
-rw-r--r-- | features/steps/shared/snippet.rb | 63 | ||||
-rw-r--r-- | features/steps/snippets/snippets.rb | 86 |
3 files changed, 0 insertions, 153 deletions
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 8a5b4112ffe..1f062dc4009 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -487,10 +487,6 @@ module SharedPaths visit explore_snippets_path end - step 'I visit new snippet page' do - visit new_snippet_path - end - def root_ref @project.repository.root_ref end diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb deleted file mode 100644 index bb596c1620a..00000000000 --- a/features/steps/shared/snippet.rb +++ /dev/null @@ -1,63 +0,0 @@ -module SharedSnippet - include Spinach::DSL - - step 'I have public "Personal snippet one" snippet' do - create(:personal_snippet, - title: "Personal snippet one", - content: "Test content", - file_name: "snippet.rb", - visibility_level: Snippet::PUBLIC, - author: current_user) - end - - step 'I have private "Personal snippet private" snippet' do - create(:personal_snippet, - title: "Personal snippet private", - content: "Provate content", - file_name: "private_snippet.rb", - visibility_level: Snippet::PRIVATE, - author: current_user) - end - - step 'I have internal "Personal snippet internal" snippet' do - create(:personal_snippet, - title: "Personal snippet internal", - content: "Provate content", - file_name: "internal_snippet.rb", - visibility_level: Snippet::INTERNAL, - author: current_user) - end - - step 'I have a public many lined snippet' do - create(:personal_snippet, - title: 'Many lined snippet', - content: <<-END.gsub(/^\s+\|/, ''), - |line one - |line two - |line three - |line four - |line five - |line six - |line seven - |line eight - |line nine - |line ten - |line eleven - |line twelve - |line thirteen - |line fourteen - END - file_name: 'many_lined_snippet.rb', - visibility_level: Snippet::PUBLIC, - author: current_user) - end - - step 'There is public "Personal snippet one" snippet' do - create(:personal_snippet, - title: "Personal snippet one", - content: "Test content", - file_name: "snippet.rb", - visibility_level: Snippet::PUBLIC, - author: create(:user)) - end -end diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb deleted file mode 100644 index a4fc77746ee..00000000000 --- a/features/steps/snippets/snippets.rb +++ /dev/null @@ -1,86 +0,0 @@ -class Spinach::Features::Snippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedSnippet - include WaitForRequests - - step 'I click link "Personal snippet one"' do - click_link "Personal snippet one" - end - - step 'I should not see "Personal snippet one" in snippets' do - expect(page).not_to have_content "Personal snippet one" - end - - step 'I click link "Edit"' do - page.within ".detail-page-header" do - first(:link, "Edit").click - end - end - - step 'I click link "Delete"' do - first(:link, "Delete").click - end - - step 'I submit new snippet "Personal snippet three"' do - fill_in "personal_snippet_title", with: "Personal snippet three" - fill_in "personal_snippet_file_name", with: "my_snippet.rb" - page.within('.file-editor') do - find('.ace_editor').native.send_keys 'Content of snippet three' - end - click_button "Create snippet" - wait_for_requests - end - - step 'I submit new internal snippet' do - fill_in "personal_snippet_title", with: "Internal personal snippet one" - fill_in "personal_snippet_file_name", with: "my_snippet.rb" - choose 'personal_snippet_visibility_level_10' - - page.within('.file-editor') do - find(:xpath, "//input[@id='personal_snippet_content']").set 'Content of internal snippet' - end - - click_button "Create snippet" - end - - step 'I should see snippet "Personal snippet three"' do - expect(page).to have_content "Personal snippet three" - expect(page).to have_content "Content of snippet three" - end - - step 'I submit new title "Personal snippet new title"' do - fill_in "personal_snippet_title", with: "Personal snippet new title" - click_button "Save" - end - - step 'I should see "Personal snippet new title"' do - expect(page).to have_content "Personal snippet new title" - end - - step 'I uncheck "Private" checkbox' do - choose "Internal" - click_button "Save" - end - - step 'I should see "Personal snippet one" public' do - expect(page).to have_no_xpath("//i[@class='public-snippet']") - end - - step 'I visit snippet page "Personal snippet one"' do - visit snippet_path(snippet) - end - - step 'I visit snippet page "Internal personal snippet one"' do - visit snippet_path(internal_snippet) - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end - - def internal_snippet - @snippet ||= PersonalSnippet.find_by!(title: "Internal personal snippet one") - end -end |