-
zhitomirskiyi a rédigé
mentioning a person from their profile page, added js & jasmine, still need to add the mention style, and prevent deselecting the last one a tiny sass add publishing from the profile works, need js translation added the translation made the hover state consistant need to fix the cucumber spec specs are green need to add a button added the buttion to mention people moved the publisher to the facebox fixed the cucumbers for the modal window
zhitomirskiyi a rédigémentioning a person from their profile page, added js & jasmine, still need to add the mention style, and prevent deselecting the last one a tiny sass add publishing from the profile works, need js translation added the translation made the hover state consistant need to fix the cucumber spec specs are green need to add a button added the buttion to mention people moved the publisher to the facebox fixed the cucumbers for the modal window
rails-spec.js 1,30 Kio
describe("rails", function() {
describe("remote forms", function() {
beforeEach(function() {
$("#jasmine_content").html(
'<form accept-charset="UTF-8" id="form" action="/status_messages" data-remote="true" method="post">' +
'<textarea id="status_message_text" name="status_message[text]">Some status message</textarea>' +
'<input type="submit">' +
'<input id="standard_hidden" type="hidden" value="keep this value">' +
'<input id="clearable_hidden" type="hidden" class="clear_on_submit" value="clear this value">' +
'</form>'
);
});
it("should retain form values if ajax fails", function() {
$('#form').trigger('ajax:failure');
expect($('#status_message_text').val()).not.toEqual("");
});
it("should clear form on ajax:success", function() {
$('#form').trigger('ajax:success');
expect($('#status_message_text').val()).toEqual("");
});
it('should not clear normal hidden fields', function(){
$('#form').trigger('ajax:success');
expect($('#standard_hidden').val()).toEqual("keep this value");
})
it('should clear hidden fields marked clear_on_submit', function(){
$('#form').trigger('ajax:success');
expect($('#clearable_hidden').val()).toEqual("");
})
});
});