diff options
author | the-undefined <joe@joejames.io> | 2016-11-03 06:34:52 +0000 |
---|---|---|
committer | the-undefined <joe@joejames.io> | 2016-11-04 06:58:40 +0000 |
commit | 27528d4490804c4bf5e16f44d12f9825cf7c6cef (patch) | |
tree | f1b01294fb8f4d6fee2e806e8b67d7fc9843df7b | |
parent | b27de4abbb6dc4566f1b18d7205bfad6dda5f10f (diff) | |
download | gitlab-ce-27528d4490804c4bf5e16f44d12f9825cf7c6cef.tar.gz |
Move spinach public snippet feature to rspec spec
- Add rspec feature for public snippets
- Remove spinach test for public snippets
-rw-r--r-- | features/snippets/public_snippets.feature | 10 | ||||
-rw-r--r-- | features/steps/snippets/public_snippets.rb | 25 | ||||
-rw-r--r-- | spec/features/snippets/public_snippets_spec.rb | 19 |
3 files changed, 19 insertions, 35 deletions
diff --git a/features/snippets/public_snippets.feature b/features/snippets/public_snippets.feature deleted file mode 100644 index c2afb63b6d8..00000000000 --- a/features/snippets/public_snippets.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Public snippets - Scenario: Unauthenticated user should see public snippets - Given There is public "Personal snippet one" snippet - And I visit snippet page "Personal snippet one" - Then I should see snippet "Personal snippet one" - - Scenario: Unauthenticated user should see raw public snippets - Given There is public "Personal snippet one" snippet - And I visit snippet raw page "Personal snippet one" - Then I should see raw snippet "Personal snippet one" diff --git a/features/steps/snippets/public_snippets.rb b/features/steps/snippets/public_snippets.rb deleted file mode 100644 index 2ebdca5ed30..00000000000 --- a/features/steps/snippets/public_snippets.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Spinach::Features::PublicSnippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I should see snippet "Personal snippet one"' do - expect(page).to have_no_xpath("//i[@class='public-snippet']") - end - - step 'I should see raw snippet "Personal snippet one"' do - expect(page).to have_text(snippet.content) - end - - step 'I visit snippet page "Personal snippet one"' do - visit snippet_path(snippet) - end - - step 'I visit snippet raw page "Personal snippet one"' do - visit raw_snippet_path(snippet) - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/spec/features/snippets/public_snippets_spec.rb b/spec/features/snippets/public_snippets_spec.rb new file mode 100644 index 00000000000..34300ccb940 --- /dev/null +++ b/spec/features/snippets/public_snippets_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +feature 'Public Snippets', feature: true do + scenario 'Unauthenticated user should see public snippets' do + public_snippet = create(:personal_snippet, :public) + + visit snippet_path(public_snippet) + + expect(page).to have_content(public_snippet.content) + end + + scenario 'Unauthenticated user should see raw public snippets' do + public_snippet = create(:personal_snippet, :public) + + visit raw_snippet_path(public_snippet) + + expect(page).to have_content(public_snippet.content) + end +end |