Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report-a-problem fixes #445

Merged
merged 2 commits into from
Aug 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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");
});
});
});