gitlab-org--gitlab-foss/spec/features/discussion_comments/snippets_spec.rb

38 lines
857 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-04-12 07:30:28 -04:00
require 'spec_helper'
RSpec.describe 'Thread Comments Snippet', :js do
let_it_be(:user) { create(:user) }
2017-04-12 07:30:28 -04:00
before do
sign_in(user)
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
it_behaves_like 'thread comments for commit and snippet', 'snippet'
2017-04-12 07:30:28 -04:00
end
context 'with personal snippets' do
let_it_be(:snippet) { create(:personal_snippet, :private, :repository, author: user) }
before do
visit snippet_path(snippet)
end
it_behaves_like 'thread comments for commit and snippet', 'snippet'
end
2017-04-12 07:30:28 -04:00
end