set the submit button to be disabled on the framer, and write a test

This commit is contained in:
Maxwell Salzberg 2012-05-24 11:06:50 -07:00
parent ed9c57e7db
commit d270910500
4 changed files with 25 additions and 3 deletions

View file

@ -123,7 +123,7 @@ app.views.framerControls = app.views.Base.extend({
},
saveFrame : function(){
this.$('button').prop('disabled', 'disabled').addClass('disabled')
this.$('input').prop('disabled', 'disabled')
this.setFormAttrs()
this.model.save()
},

View file

@ -41,6 +41,10 @@
margin-top: 5px;
}
input[disabled] {
background: inherit;
}
textarea#post_text{
height: 100px;
padding : 10px;
@ -55,6 +59,7 @@
display : none;
}
label {
@include transition(background-color);
@include border-radius();

View file

@ -14,7 +14,6 @@ describe("app.pages.Framer", function(){
this.page.model.trigger("sync")
expect(app.router.navigate).toHaveBeenCalled()
})
// want a spec here for the bookmarklet case
})
@ -36,7 +35,7 @@ describe("app.pages.Framer", function(){
this.page.render();
});
it("saves the model when you click done",function(){
it("saves the model when you click done", function(){
spyOn(app.frame, "save");
this.page.$("input.done").click();
expect(app.frame.save).toHaveBeenCalled();

View file

@ -0,0 +1,18 @@
describe("app.views.framerControls", function(){
beforeEach(function(){
loginAs(factory.user())
this.post = new factory.statusMessage({frame_name: undefined});
this.view = new app.views.framerControls({model : this.post})
})
describe("rendering", function(){
beforeEach(function(){
this.view.render();
});
it("disables the buttons when you click the X", function(){
this.view.$("input.done").click();
expect(this.view.$('input').prop('disabled')).toBeTruthy();
});
})
});