2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
require 'spec_helper'
|
2017-09-10 17:25:29 +05:30
|
|
|
|
2020-06-23 00:09:42 +05:30
|
|
|
RSpec.describe 'User deletes snippet' do
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:content) { 'puts "test"' }
|
|
|
|
let(:snippet) { create(:personal_snippet, :public, content: content, author: user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
stub_feature_flags(snippets_vue: false)
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
visit snippet_path(snippet)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'deletes the snippet' do
|
|
|
|
first(:link, 'Delete').click
|
|
|
|
|
|
|
|
expect(page).not_to have_content(snippet.title)
|
|
|
|
end
|
|
|
|
end
|