set the submit button to be disabled on the framer, and write a test
This commit is contained in:
parent
ed9c57e7db
commit
d270910500
4 changed files with 25 additions and 3 deletions
|
|
@ -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()
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
18
spec/javascripts/app/views/framer_controls_view_spec.js
Normal file
18
spec/javascripts/app/views/framer_controls_view_spec.js
Normal 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();
|
||||
});
|
||||
})
|
||||
});
|
||||
Loading…
Reference in a new issue