2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-04-12 07:30:28 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Thread Comments Snippet', :js do
|
2020-02-25 04:09:10 -05:00
|
|
|
let_it_be(:user) { create(:user) }
|
2017-04-12 07:30:28 -04:00
|
|
|
|
|
|
|
before do
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2021-01-27 07:09:01 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'with project snippets' do
|
|
|
|
let_it_be(:project) do
|
|
|
|
create(:project).tap do |p|
|
|
|
|
p.add_maintainer(user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
let_it_be(:snippet) { create(:project_snippet, :private, :repository, project: project, author: user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
visit project_snippet_path(project, snippet)
|
|
|
|
end
|
2017-04-12 07:30:28 -04:00
|
|
|
|
2021-02-23 04:10:45 -05:00
|
|
|
it_behaves_like 'thread comments for commit and snippet', 'snippet'
|
2017-04-12 07:30:28 -04:00
|
|
|
end
|
|
|
|
|
2021-01-27 07:09:01 -05:00
|
|
|
context 'with personal snippets' do
|
|
|
|
let_it_be(:snippet) { create(:personal_snippet, :private, :repository, author: user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
visit snippet_path(snippet)
|
|
|
|
end
|
|
|
|
|
2021-02-23 04:10:45 -05:00
|
|
|
it_behaves_like 'thread comments for commit and snippet', 'snippet'
|
2021-01-27 07:09:01 -05:00
|
|
|
end
|
2017-04-12 07:30:28 -04:00
|
|
|
end
|