when the "send" button is clicked.
}
$('div').remove('.modal-footer-status');
- $.ajax('/').
+ $.ajax('/report_issue', {type: 'POST'}).
success(function(data, status, jqxhr) {
var $sendButton = $('#report-issue-submit');
$sendButton.html('Report sent');
assert_no_selector 'a,button:not([disabled])', text: 'Send problem report'
assert_selector 'a,button', text: 'Cancel'
+ report = mock
+ report.expects(:deliver).returns true
+ IssueReporter.expects(:send_report).returns report
+
# enter a report text and click on report
find_field('report_issue_text').set 'my test report text'
click_button 'Send problem report'
# enter a report text and click on report
page.find_field('report_issue_text').set 'my test report text'
assert page.has_button?('Send problem report'), 'Send problem report button not enabled after entering text'
+
+ report = mock
+ report.expects(:deliver).returns true
+ IssueReporter.expects(:send_report).returns report
+
click_button 'Send problem report'
# ajax success updated button texts and added footer message