Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #50 from alphagov/shouldnt_set_requester_as_collab…

…orator

removing the requester email from collaborators
  • Loading branch information...
commit 4f35a518fa2083488f12f47f9f89c5a700141c16 2 parents bc04384 + bdaa875
@JordanHatch JordanHatch authored
View
4 app/models/shared/requester.rb
@@ -18,7 +18,9 @@ def collaborator_emails
end
def collaborator_emails=(emails_as_string)
- @collaborator_emails = emails_as_string.split(",").collect(&:strip)
+ collaborator_emails = emails_as_string.split(",").collect(&:strip)
+ filtered_collaborators = collaborator_emails.reject { |collab| collab == email }
+ @collaborator_emails = filtered_collaborators
end
def collaborator_emails_are_all_valid
View
5 test/unit/models/requester_test.rb
@@ -25,4 +25,9 @@ class RequesterTest < Test::Unit::TestCase
should "have an empty list of collaborator emails if not set" do
assert_equal [], Requester.new.collaborator_emails
end
+
+ should "remove the requester from the collaborators (as Zendesk doesn't allow this)" do
+ requester = Requester.new(email: "requester@x.com", collaborator_emails: "a@b.com, requester@x.com, c@d.com")
+ assert_equal ["a@b.com", "c@d.com"], requester.collaborator_emails
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.