gitlab-org--gitlab-foss/spec/features/snippets/user_deletes_snippet_spec.rb

20 lines
408 B
Ruby
Raw Normal View History

require 'rails_helper'
2018-07-05 02:32:05 -04:00
describe 'User deletes snippet' do
let(:user) { create(:user) }
let(:content) { 'puts "test"' }
let(:snippet) { create(:personal_snippet, :public, content: content, author: user) }
before do
sign_in(user)
visit snippet_path(snippet)
end
it 'deletes the snippet' do
first(:link, 'Delete').click
expect(page).not_to have_content(snippet.title)
end
end