Use empty_project for resources that are independent of the repo
This commit is contained in:
parent
a62ae94d9c
commit
3d227e2722
1 changed files with 18 additions and 7 deletions
|
@ -247,18 +247,14 @@ describe 'Discussion Comments', :feature, :js do
|
|||
include RepoHelpers
|
||||
|
||||
let(:user) { create(:user) }
|
||||
let(:project) { create(:project) }
|
||||
|
||||
before do
|
||||
project.team << [user, :developer]
|
||||
|
||||
login_as(user)
|
||||
end
|
||||
|
||||
describe 'on a merge request' do
|
||||
let(:project) { create(:project) }
|
||||
let(:merge_request) { create(:merge_request, source_project: project) }
|
||||
|
||||
before do
|
||||
login
|
||||
|
||||
visit namespace_project_merge_request_path(project.namespace, project, merge_request)
|
||||
end
|
||||
|
||||
|
@ -266,9 +262,12 @@ describe 'Discussion Comments', :feature, :js do
|
|||
end
|
||||
|
||||
describe 'on an issue' do
|
||||
let(:project) { create(:empty_project) }
|
||||
let(:issue) { create(:issue, project: project) }
|
||||
|
||||
before do
|
||||
login
|
||||
|
||||
visit namespace_project_issue_path(project.namespace, project, issue)
|
||||
end
|
||||
|
||||
|
@ -276,9 +275,12 @@ describe 'Discussion Comments', :feature, :js do
|
|||
end
|
||||
|
||||
describe 'on an snippet' do
|
||||
let(:project) { create(:empty_project) }
|
||||
let(:snippet) { create(:project_snippet, :private, project: project, author: user) }
|
||||
|
||||
before do
|
||||
login
|
||||
|
||||
visit namespace_project_snippet_path(project.namespace, project, snippet)
|
||||
end
|
||||
|
||||
|
@ -286,10 +288,19 @@ describe 'Discussion Comments', :feature, :js do
|
|||
end
|
||||
|
||||
describe 'on a commit' do
|
||||
let(:project) { create(:project) }
|
||||
|
||||
before do
|
||||
login
|
||||
|
||||
visit namespace_project_commit_path(project.namespace, project, sample_commit.id)
|
||||
end
|
||||
|
||||
it_behaves_like 'discussion comments', 'commit'
|
||||
end
|
||||
|
||||
def login
|
||||
project.add_master(user)
|
||||
login_as(user)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue