2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2017-06-22 10:43:52 -04:00
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'User deletes snippet' do
|
2017-06-22 10:43:52 -04:00
|
|
|
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
|