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:
Diffstat (limited to 'spec/helpers/notify_helper_spec.rb')
-rw-r--r--spec/helpers/notify_helper_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/helpers/notify_helper_spec.rb b/spec/helpers/notify_helper_spec.rb
index 9c9d745cb53..eb0f796038c 100644
--- a/spec/helpers/notify_helper_spec.rb
+++ b/spec/helpers/notify_helper_spec.rb
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe NotifyHelper do
include ActionView::Helpers::UrlHelper
+ using RSpec::Parameterized::TableSyntax
describe 'merge_request_reference_link' do
let(:project) { create(:project) }
@@ -27,6 +28,36 @@ RSpec.describe NotifyHelper do
end
end
+ describe '#invited_role_description' do
+ where(:role, :description) do
+ "Guest" | /As a guest/
+ "Reporter" | /As a reporter/
+ "Developer" | /As a developer/
+ "Maintainer" | /As a maintainer/
+ "Owner" | /As an owner/
+ "Minimal Access" | /As a user with minimal access/
+ end
+
+ with_them do
+ specify do
+ expect(helper.invited_role_description(role)).to match description
+ end
+ end
+ end
+
+ describe '#invited_to_description' do
+ where(:source, :description) do
+ "project" | /Projects can/
+ "group" | /Groups assemble/
+ end
+
+ with_them do
+ specify do
+ expect(helper.invited_to_description(source)).to match description
+ end
+ end
+ end
+
def reference_link(entity, url)
"<a href=\"#{url}\">#{entity.to_reference}</a>"
end