Skip to content

Commit

Permalink
Merge pull request #445 from alphagov/report-a-problem-fixes
Browse files Browse the repository at this point in the history
Report-a-problem fixes
  • Loading branch information
edds committed Aug 29, 2014
2 parents 15a36a1 + e9e4b27 commit 0acb658
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/report-a-problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ var ReportAProblem = {
showErrorMessage: function (jqXHR) {
var response = "<h2>Sorry, we're unable to receive your message right now.</h2> " +
"<p>We have other ways for you to provide feedback on the " +
"<a href='/feedback'>support page</a>.</p>"
$('.report-a-problem-container').html(response);
"<a href='/contact'>contact page</a>.</p>"
$('.report-a-problem-content').html(response);
},

promptUserToEnterValidData: function() {
Expand All @@ -20,7 +20,7 @@ var ReportAProblem = {
},

showConfirmation: function(data) {
$('.report-a-problem-container').html(data.message);
$('.report-a-problem-content').html(data.message);
},

submit: function() {
Expand Down
10 changes: 7 additions & 3 deletions spec/javascripts/report-a-problem-spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
describe("form submission for reporting a problem", function () {
var FORM_TEXT = '<div class="report-a-problem-container"><form><button class="button" name="button" type="submit">Send</button></form></div>';
var FORM_TEXT = '<div class="report-a-problem-container">' +
'<div class="report-a-problem-content">' +
'<form><button class="button" name="button" type="submit">Send</button></form>' +
'</div>' +
'</div>';
var form;

beforeEach(function() {
Expand Down Expand Up @@ -27,7 +31,7 @@ describe("form submission for reporting a problem", function () {
form.triggerHandler('submit');

expect(form).toBeHidden();
expect($('.report-a-problem-container').html()).toEqual('great success!');
expect($('.report-a-problem-content').html()).toEqual('great success!');
});
});

Expand All @@ -53,7 +57,7 @@ describe("form submission for reporting a problem", function () {
form.triggerHandler('submit');

expect(form).not.toBeVisible();
expect($('.report-a-problem-container').html()).toContain("Sorry, we're unable to receive your message");
expect($('.report-a-problem-content').html()).toContain("Sorry, we're unable to receive your message");
});
});
});

0 comments on commit 0acb658

Please sign in to comment.