gitlab-org--gitlab-foss/spec/features/snippets/create_snippet_spec.rb
Rémy Coutable beedd40ef7
Ensure user is authenticated to create a new snippet
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-11-28 16:57:49 +01:00

20 lines
520 B
Ruby

require 'rails_helper'
feature 'Create Snippet', feature: true do
before do
login_as :user
visit new_snippet_path
end
scenario 'Authenticated user creates a snippet' do
fill_in 'personal_snippet_title', with: 'My Snippet Title'
page.within('.file-editor') do
find(:xpath, "//input[@id='personal_snippet_content']").set 'Hello World!'
end
click_button 'Create snippet'
expect(page).to have_content('My Snippet Title')
expect(page).to have_content('Hello World!')
end
end