fix zendesk not getting the right user on new tickets

In the old form, the form would post a blank
report[email] value.  because of the way
guess_email works we can't just not submit it. 
because it needs to override the "unknown" value 
that was put there in the after_save callback when
it was created (but did not yet have an associated
user)

test_plan:
 * run the spec 
Manual steps:
 * in an environment with the canvas_zendesk_plugin
   set up, submit something a problem from the 
   help dialog
 * make sure the ticket in zendesk has the right
   email address.

Change-Id: I23d983da41e154815c7f28fe64fb70f03a0a9803
fixes: #7018
Reviewed-on: https://gerrit.instructure.com/8255
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
This commit is contained in:
Ryan Shaw 2012-01-24 10:56:22 -07:00
parent b4687d2a6a
commit 8a9a0b8f16
2 changed files with 3 additions and 2 deletions

View File

@ -56,10 +56,10 @@
<option value="blocks_what_i_need_to_do">{{#t "i_cant_get_things_done_until_i_hear_back_from_you"}}I can't get things done until I hear back from you{{/t}}</option> <option value="blocks_what_i_need_to_do">{{#t "i_cant_get_things_done_until_i_hear_back_from_you"}}I can't get things done until I hear back from you{{/t}}</option>
<option value="extreme_critical_emergency">{{#t "extreme_critical_emergency"}}EXTREME CRITICAL EMERGENCY!!{{/t}}</option> <option value="extreme_critical_emergency">{{#t "extreme_critical_emergency"}}EXTREME CRITICAL EMERGENCY!!{{/t}}</option>
</select> </select>
{{#if showEmail}} <div style="{{hiddenUnless showEmail}}">
<label for="error-email">{{#t "your_email_address"}}Your email address{{/t}}</label> <label for="error-email">{{#t "your_email_address"}}Your email address{{/t}}</label>
<input type="email" name="error[email]" id="error-email"> <input type="email" name="error[email]" id="error-email">
{{/if}} </div>
<div class="button-container"> <div class="button-container">
<button type="submit" data-text-while-loading="{{#t "Submitting_Ticket"}}Submitting Ticket...{{/t}}" class="button submit_button"><img src="/images/email.png" alt=""/>{{#t "submit_this_support_request"}}Submit Ticket{{/t}}</button> <button type="submit" data-text-while-loading="{{#t "Submitting_Ticket"}}Submitting Ticket...{{/t}}" class="button submit_button"><img src="/images/email.png" alt=""/>{{#t "submit_this_support_request"}}Submit Ticket{{/t}}</button>
</div> </div>

View File

@ -114,6 +114,7 @@ describe "help dialog" do
er.subject.should == 'test subject' er.subject.should == 'test subject'
er.comments.should == 'test comments' er.comments.should == 'test comments'
er.data['user_perceived_severity'].should == severity er.data['user_perceived_severity'].should == severity
er.guess_email.should eql @user.email
end end
it "should not show the 'Message teacher' button if not a student" do it "should not show the 'Message teacher' button if not a student" do