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-07-26 12:09:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-26 12:09:02 +0300
commitd79bf171e4bcbb551a8320211ee337368b4d114c (patch)
tree63f4305ee043eb6ca4b6f2113d8067b388b68ed8 /spec/helpers
parent6723a4288d29b11beec2de92fb7cfd682c9dcc50 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/gitlab_script_tag_helper_spec.rb10
-rw-r--r--spec/helpers/profiles_helper_spec.rb32
2 files changed, 10 insertions, 32 deletions
diff --git a/spec/helpers/gitlab_script_tag_helper_spec.rb b/spec/helpers/gitlab_script_tag_helper_spec.rb
index 35f2c0795be..9d71e25286e 100644
--- a/spec/helpers/gitlab_script_tag_helper_spec.rb
+++ b/spec/helpers/gitlab_script_tag_helper_spec.rb
@@ -14,6 +14,16 @@ RSpec.describe GitlabScriptTagHelper do
expect(helper.javascript_include_tag(script_url).to_s)
.to eq "<script src=\"/javascripts/#{script_url}\" defer=\"defer\" nonce=\"noncevalue\"></script>"
end
+
+ it 'returns a script tag with defer=false and a nonce' do
+ expect(helper.javascript_include_tag(script_url, defer: nil).to_s)
+ .to eq "<script src=\"/javascripts/#{script_url}\" nonce=\"noncevalue\"></script>"
+ end
+
+ it 'returns a script tag with a nonce even nonce is set to nil' do
+ expect(helper.javascript_include_tag(script_url, nonce: nil).to_s)
+ .to eq "<script src=\"/javascripts/#{script_url}\" defer=\"defer\" nonce=\"noncevalue\"></script>"
+ end
end
describe 'inline script tag' do
diff --git a/spec/helpers/profiles_helper_spec.rb b/spec/helpers/profiles_helper_spec.rb
index 399726263db..63641e65942 100644
--- a/spec/helpers/profiles_helper_spec.rb
+++ b/spec/helpers/profiles_helper_spec.rb
@@ -67,38 +67,6 @@ RSpec.describe ProfilesHelper do
end
end
- describe "#user_status_set_to_busy?" do
- using RSpec::Parameterized::TableSyntax
-
- where(:availability, :result) do
- "busy" | true
- "not_set" | false
- "" | false
- nil | false
- end
-
- with_them do
- it { expect(helper.user_status_set_to_busy?(OpenStruct.new(availability: availability))).to eq(result) }
- end
- end
-
- describe "#show_status_emoji?" do
- using RSpec::Parameterized::TableSyntax
-
- where(:message, :emoji, :result) do
- "Some message" | UserStatus::DEFAULT_EMOJI | true
- "Some message" | "" | true
- "" | "basketball" | true
- "" | "basketball" | true
- "" | UserStatus::DEFAULT_EMOJI | false
- "" | UserStatus::DEFAULT_EMOJI | false
- end
-
- with_them do
- it { expect(helper.show_status_emoji?(OpenStruct.new(message: message, emoji: emoji))).to eq(result) }
- end
- end
-
describe "#ssh_key_expiration_tooltip" do
using RSpec::Parameterized::TableSyntax