debian-mirror-gitlab/spec/features/discussion_comments/snippets_spec.rb

38 lines
900 B
Ruby
Raw Permalink Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
require 'spec_helper'
2023-03-04 22:38:38 +05:30
RSpec.describe 'Thread Comments Snippet', :js, feature_category: :source_code_management do
2020-04-08 14:13:33 +05:30
let_it_be(:user) { create(:user) }
2017-08-17 22:00:37 +05:30
before do
2017-09-10 17:25:29 +05:30
sign_in(user)
2021-03-11 19:13:27 +05:30
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-08-17 22:00:37 +05:30
2021-04-17 20:07:23 +05:30
it_behaves_like 'thread comments for commit and snippet', 'snippet'
2017-08-17 22:00:37 +05:30
end
2021-03-11 19:13:27 +05:30
context 'with personal snippets' do
let_it_be(:snippet) { create(:personal_snippet, :private, :repository, author: user) }
before do
visit snippet_path(snippet)
end
2021-04-17 20:07:23 +05:30
it_behaves_like 'thread comments for commit and snippet', 'snippet'
2021-03-11 19:13:27 +05:30
end
2017-08-17 22:00:37 +05:30
end