Commit 10c44bc2 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'pl-enable-lint-void' into 'master'

Fix remaining Enable RuboCop Lint/Void offenses

See merge request gitlab-org/gitlab!23269
parents aa35d995 0bea40b0
......@@ -87,15 +87,6 @@ RSpec.describe "User browses files" do
end
it "shows correct files and links" do
# rubocop:disable Lint/Void
# Test the full URLs of links instead of relative paths by `have_link(text: "...", href: "...")`.
find("a", text: /^empty$/)["href"] == project_tree_url(project, "markdown")
find("a", text: /^#id$/)["href"] == project_tree_url(project, "markdown", anchor: "#id")
find("a", text: %r{^/#id$})["href"] == project_tree_url(project, "markdown", anchor: "#id")
find("a", text: /^README.md#id$/)["href"] == project_blob_url(project, "markdown/README.md", anchor: "#id")
find("a", text: %r{^d/README.md#id$})["href"] == project_blob_url(project, "d/markdown/README.md", anchor: "#id")
# rubocop:enable Lint/Void
expect(current_path).to eq(project_tree_path(project, "markdown"))
expect(page).to have_content("README.md")
.and have_content("CHANGELOG")
......@@ -107,6 +98,11 @@ RSpec.describe "User browses files" do
.and have_link("GitLab API doc directory")
.and have_link("Maintenance")
.and have_header_with_correct_id_and_link(2, "Application details", "application-details")
.and have_link("empty", href: "")
.and have_link("#id", href: "#id")
.and have_link("/#id", href: project_blob_path(project, "markdown/README.md", anchor: "id"))
.and have_link("README.md#id", href: project_blob_path(project, "markdown/README.md", anchor: "id"))
.and have_link("d/README.md#id", href: project_blob_path(project, "markdown/db/README.md", anchor: "id"))
end
it "shows correct content of file" do
......@@ -148,16 +144,13 @@ RSpec.describe "User browses files" do
click_link("d")
end
# rubocop:disable Lint/Void
# Test the full URLs of links instead of relative paths by `have_link(text: "...", href: "...")`.
find("a", text: "..")["href"] == project_tree_url(project, "markdown/d")
# rubocop:enable Lint/Void
expect(page).to have_link("..", href: project_tree_path(project, "markdown/"))
page.within(".tree-table") do
click_link("README.md")
end
# Test the full URLs of links instead of relative paths by `have_link(text: "...", href: "...")`.
find("a", text: /^empty$/)["href"] == project_blob_url(project, "markdown/d/README.md")
expect(page).to have_link("empty", href: "")
end
it "shows correct content of directory" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment