2012-08-02 00:30:36 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-04-12 08:56:37 +00:00
|
|
|
describe "GitLab Flavored Markdown", feature: true do
|
2017-03-28 21:13:16 +00:00
|
|
|
let(:project) { create(:empty_project) }
|
2012-11-06 03:31:55 +00:00
|
|
|
let(:issue) { create(:issue, project: project) }
|
2012-08-02 00:30:36 +00:00
|
|
|
let(:fred) do
|
2017-03-28 21:13:16 +00:00
|
|
|
create(:user, name: 'fred') do |user|
|
|
|
|
project.add_master(user)
|
|
|
|
end
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
2017-03-28 21:13:16 +00:00
|
|
|
login_as(:user)
|
|
|
|
project.add_developer(@user)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
2012-09-14 22:00:59 +00:00
|
|
|
|
2017-03-28 21:13:16 +00:00
|
|
|
describe "for commits" do
|
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
let(:commit) { project.commit }
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2017-03-28 21:13:16 +00:00
|
|
|
before do
|
|
|
|
allow_any_instance_of(Commit).to receive(:title).
|
|
|
|
and_return("fix #{issue.to_reference}\n\nask #{fred.to_reference} for details")
|
|
|
|
end
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders title in commits#index" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_commits_path(project.namespace, project, 'master', limit: 1)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders title in commits#show" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_commit_path(project.namespace, project, commit)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders description in commits#show" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_commit_path(project.namespace, project, commit)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(fred.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders title in repositories#branches" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_branches_path(project.namespace, project)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-04-06 01:13:06 +00:00
|
|
|
describe "for issues", feature: true, js: true do
|
|
|
|
include WaitForVueResource
|
|
|
|
|
2012-08-02 00:30:36 +00:00
|
|
|
before do
|
2012-11-06 03:31:55 +00:00
|
|
|
@other_issue = create(:issue,
|
|
|
|
author: @user,
|
|
|
|
assignee: @user,
|
|
|
|
project: project)
|
|
|
|
@issue = create(:issue,
|
2012-08-10 22:07:50 +00:00
|
|
|
author: @user,
|
|
|
|
assignee: @user,
|
2012-11-06 03:31:55 +00:00
|
|
|
project: project,
|
2015-05-21 20:35:15 +00:00
|
|
|
title: "fix #{@other_issue.to_reference}",
|
|
|
|
description: "ask #{fred.to_reference} for details")
|
2017-05-03 17:41:16 +00:00
|
|
|
|
|
|
|
@note = create(:note_on_issue, noteable: @issue, project: @issue.project, note: "Hello world")
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders subject in issues#index" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_issues_path(project.namespace, project)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(@other_issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders subject in issues#show" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_issue_path(project.namespace, project, @issue)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(@other_issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders details in issues#show" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_issue_path(project.namespace, project, @issue)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-08-31 22:09:18 +00:00
|
|
|
expect(page).to have_link(fred.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "for merge requests" do
|
2017-03-28 21:13:16 +00:00
|
|
|
let(:project) { create(:project, :repository) }
|
|
|
|
|
2012-08-02 00:30:36 +00:00
|
|
|
before do
|
2015-05-21 20:35:15 +00:00
|
|
|
@merge_request = create(:merge_request, source_project: project, target_project: project, title: "fix #{issue.to_reference}")
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders title in merge_requests#index" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_merge_requests_path(project.namespace, project)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders title in merge_requests#show" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_merge_request_path(project.namespace, project, @merge_request)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "for milestones" do
|
|
|
|
before do
|
2012-11-06 03:31:55 +00:00
|
|
|
@milestone = create(:milestone,
|
|
|
|
project: project,
|
2015-05-21 20:35:15 +00:00
|
|
|
title: "fix #{issue.to_reference}",
|
|
|
|
description: "ask #{fred.to_reference} for details")
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders title in milestones#index" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_milestones_path(project.namespace, project)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders title in milestones#show" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_milestone_path(project.namespace, project, @milestone)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(issue.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
|
2016-07-25 18:16:19 +00:00
|
|
|
it "renders description in milestones#show" do
|
2015-01-24 18:02:58 +00:00
|
|
|
visit namespace_project_milestone_path(project.namespace, project, @milestone)
|
2012-08-02 00:30:36 +00:00
|
|
|
|
2015-05-21 20:35:15 +00:00
|
|
|
expect(page).to have_link(fred.to_reference)
|
2012-08-02 00:30:36 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|