diff options
author | Stan Hu <stanhu@gmail.com> | 2015-06-19 21:18:24 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-06-19 21:23:46 -0700 |
commit | e785b9d2e24ca7e16e8ff3fa46f2e2b82478be9b (patch) | |
tree | 06f762b77dee4c8a05fecd4dd42d0b1dfefee5e5 /features/steps/snippets/snippets.rb | |
parent | 74a6732c0dfc1416cad382203544d9c4d6246f58 (diff) | |
download | gitlab-ce-e785b9d2e24ca7e16e8ff3fa46f2e2b82478be9b.tar.gz |
Fix Error 500 when one user attempts to access a personal, internal snippet
Closes #1815
Diffstat (limited to 'features/steps/snippets/snippets.rb')
-rw-r--r-- | features/steps/snippets/snippets.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb index 09fdd1b5a13..426da2918ea 100644 --- a/features/steps/snippets/snippets.rb +++ b/features/steps/snippets/snippets.rb @@ -31,6 +31,18 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps click_button "Create snippet" 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" @@ -58,7 +70,15 @@ class Spinach::Features::Snippets < Spinach::FeatureSteps 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 |