Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-06 09:07:56 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-06 09:07:56 +0300
commita5185ab98611ded25864ffdf3e358e4a139f4928 (patch)
tree2e355814695ef1acc701190406024e3f3c180872 /spec/haml_lint
parent47efbe732cd3251aae4b13792fa058210e8328ab (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/haml_lint')
-rw-r--r--spec/haml_lint/linter/documentation_links_spec.rb5
-rw-r--r--spec/haml_lint/linter/inline_javascript_spec.rb31
-rw-r--r--spec/haml_lint/linter/no_plain_nodes_spec.rb5
3 files changed, 37 insertions, 4 deletions
diff --git a/spec/haml_lint/linter/documentation_links_spec.rb b/spec/haml_lint/linter/documentation_links_spec.rb
index f2aab4304c1..49a720700da 100644
--- a/spec/haml_lint/linter/documentation_links_spec.rb
+++ b/spec/haml_lint/linter/documentation_links_spec.rb
@@ -1,9 +1,10 @@
# frozen_string_literal: true
-require 'spec_helper'
+require 'fast_spec_helper'
require 'haml_lint'
require 'haml_lint/spec'
-require Rails.root.join('haml_lint/linter/documentation_links')
+
+require_relative '../../../haml_lint/linter/documentation_links'
RSpec.describe HamlLint::Linter::DocumentationLinks do
include_context 'linter'
diff --git a/spec/haml_lint/linter/inline_javascript_spec.rb b/spec/haml_lint/linter/inline_javascript_spec.rb
new file mode 100644
index 00000000000..fb35bb68247
--- /dev/null
+++ b/spec/haml_lint/linter/inline_javascript_spec.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+require 'fast_spec_helper'
+require 'haml_lint'
+require 'haml_lint/spec'
+require 'rspec-parameterized'
+
+require_relative '../../../haml_lint/linter/inline_javascript'
+
+RSpec.describe HamlLint::Linter::InlineJavaScript do # rubocop:disable RSpec/FilePath
+ using RSpec::Parameterized::TableSyntax
+
+ include_context 'linter'
+
+ let(:message) { described_class::MSG }
+
+ where(:haml, :should_report) do
+ '%script' | true
+ '%javascript' | false
+ ':javascript' | true
+ ':markdown' | false
+ end
+
+ with_them do
+ if params[:should_report]
+ it { is_expected.to report_lint message: message }
+ else
+ it { is_expected.not_to report_lint }
+ end
+ end
+end
diff --git a/spec/haml_lint/linter/no_plain_nodes_spec.rb b/spec/haml_lint/linter/no_plain_nodes_spec.rb
index 08f7e6131cc..eeb0e4ea96f 100644
--- a/spec/haml_lint/linter/no_plain_nodes_spec.rb
+++ b/spec/haml_lint/linter/no_plain_nodes_spec.rb
@@ -1,9 +1,10 @@
# frozen_string_literal: true
-require 'spec_helper'
+require 'fast_spec_helper'
require 'haml_lint'
require 'haml_lint/spec'
-require Rails.root.join('haml_lint/linter/no_plain_nodes')
+
+require_relative '../../../haml_lint/linter/no_plain_nodes'
RSpec.describe HamlLint::Linter::NoPlainNodes do
include_context 'linter'