Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

reinsert removing_need_to_specify_requester_email

Revert "Revert "Merge pull request #30 from alphagov/removing_need_to_specify_requester_email""

This reverts commit 156bb70.

Conflicts:

	Gemfile.lock
	test/test_helper.rb
  • Loading branch information...
commit 51e6830fe4459e0ea268e2aa8c697a444d0a4383 1 parent a9e52ec
Jake Benilov benilovj authored

Showing 32 changed files with 183 additions and 71 deletions. Show diff stats Hide diff stats

  1. +1 0  Gemfile
  2. +18 0 Gemfile.lock
  3. +1 0  app/assets/javascripts/application.js
  4. +1 1  app/controllers/create_new_user_requests_controller.rb
  5. +1 1  app/controllers/remove_user_requests_controller.rb
  6. +8 0 app/controllers/requests_controller.rb
  7. +0 23 app/models/read_only_user.rb
  8. +3 1 app/models/shared/requester.rb
  9. +38 0 app/models/user.rb
  10. +1 1  app/views/campaign_requests/new.html.erb
  11. +1 1  app/views/content_change_requests/new.html.erb
  12. +0 2  app/views/create_new_user_requests/new.html.erb
  13. +1 1  app/views/general_requests/new.html.erb
  14. +18 0 app/views/layouts/application.html.erb
  15. +1 1  app/views/new_feature_requests/new.html.erb
  16. +0 2  app/views/remove_user_requests/new.html.erb
  17. +3 0  app/views/support/_collaborators.html.erb
  18. +0 6 app/views/support/_requester.html.erb
  19. +2 0  config/application.rb
  20. +1 1  config/initializers/gds-sso.rb
  21. +1 1  features/general_requests.feature
  22. +2 2 features/remove_user_requests.feature
  23. +0 16 features/step_definitions/request_steps.rb
  24. +3 2 features/step_definitions/user_steps.rb
  25. +2 1  lib/zendesk_ticket.rb
  26. +1 1  lib/zendesk_tickets.rb
  27. +13 1 test/functional/requests_controller_test.rb
  28. +16 1 test/functional/support_controller_test.rb
  29. +4 4 test/test_helper.rb
  30. +2 0  test/unit/models/requester_test.rb
  31. +38 0 test/unit/models/user_test.rb
  32. +2 1  test/unit/zendesk/zendesk_ticket_test.rb
1  Gemfile
@@ -24,6 +24,7 @@ if ENV['GDS_ZENDESK_DEV']
24 24 else
25 25 gem "gds_zendesk", '0.0.5'
26 26 end
  27 +gem 'redis-rails', '3.2.3'
27 28
28 29 group :test do
29 30 gem "mocha", "0.12.6", require: false
18 Gemfile.lock
@@ -182,6 +182,23 @@ GEM
182 182 rake (10.0.3)
183 183 rdoc (3.12.1)
184 184 json (~> 1.4)
  185 + redis (3.0.2)
  186 + redis-actionpack (3.2.3)
  187 + actionpack (~> 3.2.3)
  188 + redis-rack (~> 1.4.0)
  189 + redis-store (~> 1.1.0)
  190 + redis-activesupport (3.2.3)
  191 + activesupport (~> 3.2.3)
  192 + redis-store (~> 1.1.0)
  193 + redis-rack (1.4.2)
  194 + rack (~> 1.4.1)
  195 + redis-store (~> 1.1.0)
  196 + redis-rails (3.2.3)
  197 + redis-actionpack (~> 3.2.3)
  198 + redis-activesupport (~> 3.2.3)
  199 + redis-store (~> 1.1.0)
  200 + redis-store (1.1.3)
  201 + redis (>= 2.2.0)
185 202 rubyzip (0.9.9)
186 203 sass (3.2.5)
187 204 sass-rails (3.2.6)
@@ -258,6 +275,7 @@ DEPENDENCIES
258 275 plek (= 1.1.0)
259 276 poltergeist (= 0.7.0)
260 277 rails (= 3.2.12)
  278 + redis-rails (= 3.2.3)
261 279 sass-rails (~> 3.2.3)
262 280 shoulda (~> 3.3.2)
263 281 therubyracer (~> 0.9.4)
1  app/assets/javascripts/application.js
@@ -13,6 +13,7 @@
13 13 //= require jquery
14 14 //= require jquery_ujs
15 15 //= require jquery.ui.datepicker
  16 +//= require twitter/bootstrap/dropdown
16 17 //= require twitter/bootstrap/collapse
17 18 //= require_tree .
18 19
2  app/controllers/create_new_user_requests_controller.rb
@@ -5,7 +5,7 @@
5 5 class CreateNewUserRequestsController < RequestsController
6 6 protected
7 7 def new_request
8   - CreateNewUserRequest.new(requester: Requester.new, requested_user: RequestedUser.new)
  8 + CreateNewUserRequest.new(requested_user: RequestedUser.new)
9 9 end
10 10
11 11 def zendesk_ticket_class
2  app/controllers/remove_user_requests_controller.rb
@@ -3,7 +3,7 @@
3 3 class RemoveUserRequestsController < RequestsController
4 4 protected
5 5 def new_request
6   - RemoveUserRequest.new(:requester => Requester.new, :time_constraint => TimeConstraint.new)
  6 + RemoveUserRequest.new(time_constraint: TimeConstraint.new)
7 7 end
8 8
9 9 def zendesk_ticket_class
8 app/controllers/requests_controller.rb
@@ -8,6 +8,8 @@ def new
8 8
9 9 def create
10 10 @request = parse_request_from_params
  11 + set_logged_in_user_as_requester_on(@request)
  12 +
11 13 if @request.valid?
12 14 process_valid_request(@request)
13 15 else
@@ -21,6 +23,12 @@ def process_valid_request(submitted_request)
21 23 end
22 24
23 25 private
  26 + def set_logged_in_user_as_requester_on(request)
  27 + request.requester ||= Requester.new
  28 + request.requester.name = current_user.name
  29 + request.requester.email = current_user.email
  30 + end
  31 +
24 32 def raise_ticket(ticket)
25 33 ticket = ZendeskTickets.new(GDS_ZENDESK_CLIENT).raise_ticket(ticket)
26 34
23 app/models/read_only_user.rb
... ... @@ -1,23 +0,0 @@
1   -require 'gds-sso/user'
2   -
3   -class ReadOnlyUser < OpenStruct
4   - def self.attr_accessible(*args)
5   - end
6   -
7   - include GDS::SSO::User
8   -
9   - def self.find_by_uid(uid)
10   - ReadOnlyUser.new(uid: uid)
11   - end
12   -
13   - def self.create!(auth_hash, options={})
14   - ReadOnlyUser.new(auth_hash)
15   - end
16   -
17   - def update_attribute(*args)
18   - end
19   -
20   - def update_attributes(params, hash)
21   - ReadOnlyUser.new(params)
22   - end
23   -end
4 app/models/shared/requester.rb
... ... @@ -1,12 +1,14 @@
1 1 require 'shared/tableless_model'
2 2
3 3 class Requester < TablelessModel
4   - attr_accessor :email
  4 + attr_accessor :email, :name
5 5
6 6 validates_presence_of :email
7 7
8 8 validates :email, format: { with: /@/ }
9 9
  10 + validates_presence_of :name
  11 +
10 12 validate :collaborator_emails_are_all_valid
11 13
12 14 def email=(new_email)
38 app/models/user.rb
... ... @@ -0,0 +1,38 @@
  1 +require 'gds-sso/user'
  2 +
  3 +class User < OpenStruct
  4 + def self.attr_accessible(*args)
  5 + end
  6 +
  7 + include GDS::SSO::User
  8 +
  9 + def self.find_by_uid(uid)
  10 + auth_hash = Rails.cache.fetch(uid)
  11 + auth_hash ? User.new(auth_hash) : nil
  12 + end
  13 +
  14 + def self.create!(auth_hash, options={})
  15 + Rails.cache.write(auth_hash["uid"], auth_hash)
  16 + User.new(auth_hash)
  17 + end
  18 +
  19 + def remotely_signed_out?
  20 + remotely_signed_out
  21 + end
  22 +
  23 + def update_attribute(key, value)
  24 + if uid
  25 + old_attributes = Rails.cache.fetch(uid)
  26 + new_attributes = old_attributes.merge(key => value)
  27 + Rails.cache.write(new_attributes["uid"], new_attributes)
  28 + end
  29 + send("#{key}=", value)
  30 + end
  31 +
  32 + def update_attributes(params, hash)
  33 + params.each do |key, value|
  34 + send("#{key}=", value)
  35 + end
  36 + Rails.cache.write(params["uid"], params)
  37 + end
  38 +end
2  app/views/campaign_requests/new.html.erb
@@ -4,7 +4,7 @@
4 4 <div class="well">
5 5 <%= semantic_form_for @request, url: { action: "create" }, html: { novalidate: false } do |f| %>
6 6
7   - <%= render partial: "support/requester", locals: { f: f, show_collaborators: true } %>
  7 + <%= render partial: "support/collaborators", locals: { f: f } %>
8 8
9 9 <%= render partial: "campaign_details", locals: { f: f } %>
10 10
2  app/views/content_change_requests/new.html.erb
@@ -21,7 +21,7 @@
21 21 <div class="well">
22 22 <%= semantic_form_for @request, url: { action: "create" }, html: { novalidate: false } do |f| %>
23 23
24   - <%= render partial: "support/requester", locals: { f: f, show_collaborators: true } %>
  24 + <%= render partial: "support/collaborators", locals: { f: f } %>
25 25
26 26 <%= render partial: "request_details", locals: { f: f} %>
27 27
2  app/views/create_new_user_requests/new.html.erb
@@ -4,8 +4,6 @@
4 4 <div class="well">
5 5 <%= semantic_form_for @request, url: { action: "create" }, html: { novalidate: false } do |f| %>
6 6
7   - <%= render partial: "support/requester", locals: { f: f, show_collaborators: false } %>
8   -
9 7 <%= render partial: "request_details", locals: { f: f } %>
10 8
11 9 <%= f.action :submit, label: "Submit", button_html: { class: "btn btn-success" } %>
2  app/views/general_requests/new.html.erb
@@ -12,7 +12,7 @@
12 12 <div class="well">
13 13 <%= semantic_form_for @request, url: { action: "create" }, html: { novalidate: false } do |f| %>
14 14
15   - <%= render partial: "support/requester", locals: { f: f, show_collaborators: true } %>
  15 + <%= render partial: "support/collaborators", locals: { f: f } %>
16 16
17 17 <%= render partial: "request_details", locals: { f: f } %>
18 18
18 app/views/layouts/application.html.erb
@@ -16,6 +16,24 @@
16 16 <div class="navbar-inner">
17 17 <div class="container-fluid">
18 18 <%= link_to 'GOV.UK Support', root_path, :class => "brand" %>
  19 + <ul class="nav pull-right">
  20 + <li class="dropdown">
  21 + <a href="#"
  22 + class="dropdown-toggle"
  23 + data-toggle="dropdown">
  24 + Services
  25 + <b class="caret"></b>
  26 + </a>
  27 + <ul class="dropdown-menu">
  28 + <li><a href="http://digital.cabinetoffice.gov.uk/">GDS blog</a></li>
  29 + <li><a href="http://wiki.digital.cabinet-office.gov.uk/">GDS wiki</a></li>
  30 + <li class="divider"></li>
  31 + <li><%= link_to 'Sign out', gds_sign_out_path %></li>
  32 + </ul>
  33 + </li>
  34 + </ul>
  35 +
  36 + <p id="logged-in-user" class="navbar-text pull-right">Signed in as <a href="<%= Plek.current.find('signon') %>"><%= current_user.name %></a></p>
19 37 </div>
20 38 </div>
21 39 </header>
2  app/views/new_feature_requests/new.html.erb
@@ -4,7 +4,7 @@
4 4 <div class="well">
5 5 <%= semantic_form_for @request, url: { action: "create" }, html: { novalidate: false } do |f| %>
6 6
7   - <%= render partial: "support/requester", locals: { f: f, show_collaborators: true } %>
  7 + <%= render partial: "support/collaborators", locals: { f: f } %>
8 8
9 9 <%= render partial: "request_details", locals: { f: f } %>
10 10
2  app/views/remove_user_requests/new.html.erb
@@ -4,8 +4,6 @@
4 4 <div class="well">
5 5 <%= semantic_form_for @request, url: { action: "create" }, html: { novalidate: false } do |f| %>
6 6
7   - <%= render partial: "support/requester", locals: { f: f, show_collaborators: false } %>
8   -
9 7 <%= render partial: "request_details", locals: { f: f } %>
10 8
11 9 <%= f.action :submit, label: "Submit", button_html: { class: "btn btn-success" } %>
3  app/views/support/_collaborators.html.erb
... ... @@ -0,0 +1,3 @@
  1 +<%= f.semantic_fields_for :requester do |r| %>
  2 + <%= r.input :collaborator_emails, label: "Should anybody else be copied in on this request? (comma-separated list of emails)", required: false, input_html: { class: "span6", value: r.object.collaborator_emails.join(", ") } %>
  3 +<% end %>
6 app/views/support/_requester.html.erb
... ... @@ -1,6 +0,0 @@
1   -<%= f.semantic_fields_for :requester do |r| %>
2   - <%= r.input :email, label: "Your email", as: :email, required: true, input_html: { :"aria-required" => true, :class => "span6" } %>
3   - <% if show_collaborators %>
4   - <%= r.input :collaborator_emails, label: "Should anybody else be copied in on this request? (comma-separated list of emails)", required: false, input_html: { class: "span6", value: r.object.collaborator_emails.join(", ") } %>
5   - <% end %>
6   -<% end %>
2  config/application.rb
@@ -49,6 +49,8 @@ class Application < Rails::Application
49 49 # Enable escaping HTML in JSON.
50 50 config.active_support.escape_html_entities_in_json = true
51 51
  52 + config.cache_store = :redis_store
  53 +
52 54 # Use SQL instead of Active Record's schema dumper when creating the database.
53 55 # This is necessary if your schema can't be completely dumped by the schema dumper,
54 56 # like if you have constraints or database-specific column types
2  config/initializers/gds-sso.rb
... ... @@ -1,5 +1,5 @@
1 1 GDS::SSO.config do |config|
2   - config.user_model = 'ReadOnlyUser'
  2 + config.user_model = 'User'
3 3 config.oauth_id = 'abcdefghjasndjkasndsupport'
4 4 config.oauth_secret = 'secret'
5 5 config.default_scope = "Support"
2  features/general_requests.feature
@@ -14,7 +14,7 @@ Feature: General requests
14 14 | The site is down | https://www.gov.uk |
15 15 Then the following ticket is raised in ZenDesk:
16 16 | Subject | Requester email | Requester name |
17   - | Govt Agency General Issue | john.smith@email.com | john.smith@email.com |
  17 + | Govt Agency General Issue | john.smith@email.com | John Smith |
18 18 And the ticket is tagged with "govt_form govt_agency_general"
19 19 And the comment on the ticket is:
20 20 """
4 features/remove_user_requests.feature
@@ -5,8 +5,8 @@ Feature: Remove user requests
5 5
6 6 Background:
7 7 * the following user has SSO access:
8   - | Name | Email | Job title | Phone |
9   - | John Smith | john.smith@email.com | Developer | 12345 |
  8 + | Name | Email |
  9 + | John Smith | john.smith@email.com |
10 10
11 11 Scenario: successful remove user request for publisher
12 12 When the user submits the following remove user request:
16 features/step_definitions/request_steps.rb
... ... @@ -1,7 +1,3 @@
1   -When /^the user fills out their details$/ do
2   - fill_in "Your email", :with => @user_details["Email"]
3   -end
4   -
5 1 When /^the user fills out the time constraints$/ do
6 2 fill_in "MUST be published by", :with => @request_details["Needed by date"]
7 3 fill_in "MUST NOT be published BEFORE", :with => @request_details["Not before date"]
@@ -22,8 +18,6 @@
22 18
23 19 assert page.has_content?("Report a problem")
24 20
25   - step "the user fills out their details"
26   -
27 21 fill_in "Details", :with => @request_details['Details']
28 22 fill_in "URL (if applicable)", :with => @request_details['URL']
29 23
@@ -39,8 +33,6 @@
39 33
40 34 assert page.has_content?("Request a new feature/need")
41 35
42   - step "the user fills out their details"
43   -
44 36 within "#request-context" do
45 37 choose @request_details["Context"]
46 38 end
@@ -61,8 +53,6 @@
61 53
62 54 assert page.has_content?("Request a change")
63 55
64   - step "the user fills out their details"
65   -
66 56 within "#request-context" do
67 57 choose @request_details["Context"]
68 58 end
@@ -85,8 +75,6 @@
85 75
86 76 assert page.has_content?("Create a new user account")
87 77
88   - step "the user fills out their details"
89   -
90 78 within "#tool-role-choice" do
91 79 choose @request_details["Tool/Role"]
92 80 end
@@ -112,8 +100,6 @@
112 100
113 101 assert page.has_content?("Request to remove user access")
114 102
115   - step "the user fills out their details"
116   -
117 103 within "#tool-role-choice" do
118 104 choose @request_details["Tool/Role"]
119 105 end
@@ -138,8 +124,6 @@
138 124
139 125 assert page.has_content?("Request GDS support for a campaign")
140 126
141   - step "the user fills out their details"
142   -
143 127 fill_in "Campaign title", :with => @request_details["Campaign title"]
144 128 fill_in "ERG reference number", :with => @request_details["ERG ref number"]
145 129 fill_in "Start date", :with => @request_details["Start date"]
5 features/step_definitions/user_steps.rb
... ... @@ -1,6 +1,7 @@
1 1 Given /^the following user has SSO access:$/ do |user_details|
2   - user = stub_everything('user', :name => "user", :has_permission? => true)
3   - @user_details = user_details.hashes.first
  2 + user_details = user_details.hashes.first
  3 +
  4 + user = stub_everything('user', name: user_details["Name"], email: user_details["Email"], has_permission?: true)
4 5
5 6 login_as user
6 7 end
3  lib/zendesk_ticket.rb
@@ -12,7 +12,7 @@ def initialize(request)
12 12 @requester = request.requester
13 13 end
14 14
15   - def_delegators :@requester, :email, :collaborator_emails
  15 + def_delegators :@requester, :email, :name, :collaborator_emails
16 16
17 17 def comment
18 18 SnippetCollection.new(comment_snippets).to_s
@@ -49,6 +49,7 @@ def to_s
49 49 private
50 50 def base_attribute_snippets
51 51 [
  52 + LabelledSnippet.new(on: @requester, field: :name, label: "Requester name"),
52 53 LabelledSnippet.new(on: @requester, field: :email, label: "Requester email"),
53 54 LabelledSnippet.new(on: @requester, field: :collaborator_emails),
54 55 LabelledSnippet.new(on: self, field: :tags),
2  lib/zendesk_tickets.rb
@@ -10,7 +10,7 @@ def raise_ticket(ticket_to_raise)
10 10 :subject => ticket_to_raise.subject,
11 11 :description => "Created via Govt API",
12 12 :priority => "normal",
13   - :requester => {"locale_id" => 1, "email" => ticket_to_raise.email, "name" => ticket_to_raise.email},
  13 + :requester => {"locale_id" => 1, "email" => ticket_to_raise.email, "name" => ticket_to_raise.name},
14 14 :collaborators => ticket_to_raise.collaborator_emails,
15 15 :fields => [{"id" => GDSZendesk::FIELD_MAPPINGS[:needed_by_date], "value" => ticket_to_raise.needed_by_date},
16 16 {"id" => GDSZendesk::FIELD_MAPPINGS[:not_before_date], "value" => ticket_to_raise.not_before_date}],
14 test/functional/requests_controller_test.rb
@@ -48,6 +48,9 @@ def valid_params_for_test_request
48 48
49 49 class RequestsControllerTest < ActionController::TestCase
50 50 setup do
  51 + @logged_in_user_details = { name: "John Smith", email: "john.smith@gov.uk" }
  52 + login_as_stub_user(@logged_in_user_details[:name], @logged_in_user_details[:email])
  53 +
51 54 Rails.application.routes.draw do
52 55 match 'new' => "test_requests#new"
53 56 match 'create' => "test_requests#create"
@@ -105,6 +108,15 @@ def prevent_implicit_rendering
105 108 post :create, params
106 109 end
107 110
  111 + should "read the signed-in user's details as the requester" do
  112 + params = valid_params_for_test_request
  113 +
  114 + post :create, params
  115 +
  116 + assert_equal @logged_in_user_details[:email], @zendesk_api.ticket.email
  117 + assert_equal @logged_in_user_details[:name], @zendesk_api.ticket.name
  118 + end
  119 +
108 120 should "set collaborators if they're set on the request" do
109 121 params = valid_params_for_test_request.tap do |p|
110 122 p["test_request"]["requester_attributes"].merge!("collaborator_emails" => "ab@c.com, def@g.com")
@@ -114,4 +126,4 @@ def prevent_implicit_rendering
114 126 assert_equal ["ab@c.com", "def@g.com"], @zendesk_api.ticket.collaborators
115 127 end
116 128 end
117   -end
  129 +end
17 test/functional/support_controller_test.rb
... ... @@ -1,10 +1,25 @@
1 1 require "test_helper"
2 2
3 3 class SupportControllerTest < ActionController::TestCase
  4 + setup do
  5 + login_as_stub_user(name: "John")
  6 + end
  7 +
4 8 context "GET landing" do
5   - should "render the homepage" do
  9 + setup do
6 10 get :landing
  11 + end
  12 +
  13 + should "render the homepage" do
7 14 assert_select "h1", /Welcome to GOV.UK Support/i
8 15 end
  16 +
  17 + should "show the name of the user who is logged in" do
  18 + assert_select '#logged-in-user a', content: "John"
  19 + end
  20 +
  21 + should "show have a link to log out" do
  22 + assert_select "a[href=/auth/gds/sign_out]", html: "Sign out"
  23 + end
9 24 end
10 25 end
8 test/test_helper.rb
@@ -12,14 +12,14 @@ class ActiveSupport::TestCase
12 12 def setup
13 13 super
14 14 WebMock.disable_net_connect!
15   - login_as_stub_user
  15 + login_as_stub_user if @user.nil?
16 16 switch_zendesk_into_dummy_mode
17 17 end
18 18
19   - def login_as_stub_user
  19 + def login_as_stub_user(name = "Stubby McStubby", email = "stubby@gov.uk")
20 20 @user = stub("stub user",
21   - name: "Stubby McStubby", remotely_signed_out?: false)
22   - request.env['warden'] = stub(:authenticate! => true, :authenticated? => true, :user => @user) unless request.nil?
  21 + name: name, remotely_signed_out?: false, email: email)
  22 + @request.env['warden'] = stub(:authenticate! => true, :authenticated? => true, :user => @user)
23 23 end
24 24
25 25 def switch_zendesk_into_dummy_mode
2  test/unit/models/requester_test.rb
@@ -3,6 +3,8 @@
3 3 class RequesterTest < Test::Unit::TestCase
4 4 should validate_presence_of(:email)
5 5
  6 + should validate_presence_of(:name)
  7 +
6 8 should allow_value("ab@c.com").for(:email)
7 9 should allow_value("ab@ c.com").for(:email)
8 10 should allow_value("ab @c.com").for(:email)
38 test/unit/models/user_test.rb
... ... @@ -0,0 +1,38 @@
  1 +require 'test_helper'
  2 +
  3 +class UserTest < Test::Unit::TestCase
  4 + def setup
  5 + Rails.cache.clear
  6 + end
  7 +
  8 + should "support persistent creation and retrieval" do
  9 + assert_nil User.find_by_uid("12345")
  10 + user = User.create!("uid" => "12345", "name" => "A", "email" => "a@b.com")
  11 +
  12 + u = User.find_by_uid("12345")
  13 + assert_not_nil u
  14 + assert_equal "A", u.name
  15 + assert_equal "a@b.com", u.email
  16 + end
  17 +
  18 + should "support remote sign-out" do
  19 + user = User.create!("uid" => "12345", "name" => "A", "email" => "a@b.com")
  20 + assert !user.remotely_signed_out?
  21 +
  22 + user.update_attribute(:remotely_signed_out, true)
  23 + assert user.remotely_signed_out?
  24 +
  25 + assert User.find_by_uid("12345").remotely_signed_out?
  26 + end
  27 +
  28 + should "support mass updating of attributes" do
  29 + user = User.create!("uid" => "12345", "name" => "A", "email" => "a@b.com")
  30 +
  31 + user.update_attributes({ "uid" => "12345", "name" => "Z", "email" => "x@y.com" }, { as: :somebody })
  32 +
  33 + assert_equal "Z", user.name
  34 + assert_equal "x@y.com", user.email
  35 +
  36 + assert_equal "Z", User.find_by_uid("12345").name
  37 + end
  38 +end
3  test/unit/zendesk/zendesk_ticket_test.rb
@@ -39,11 +39,12 @@ def with_a_valid_requester
39 39 end
40 40
41 41 should "have a text representation" do
42   - ticket = new_ticket(with_requester(email: "ab@c.com", collaborator_emails: "a, b"))
  42 + ticket = new_ticket(with_requester(email: "ab@c.com", name: "A B", collaborator_emails: "a, b"))
43 43 ticket.stubs(:comment_snippets).returns([])
44 44
45 45 assert_includes ticket.to_s, "ab@c.com"
46 46 assert_includes ticket.to_s, "a, b"
  47 + assert_includes ticket.to_s, "A B"
47 48 end
48 49
49 50 context "with time constraints" do

0 comments on commit 51e6830

Please sign in to comment.
Something went wrong with that request. Please try again.