-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #734 from tf/disable-reference-input
Add disabled option to ReferenceInputView
- Loading branch information
Showing
4 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
spec/javascripts/views/inputs/reference_input_view_spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
describe('pageflow.ReferenceInputView', function() { | ||
var Model = Backbone.Model.extend({ | ||
i18nKey: 'page' | ||
}); | ||
|
||
var TestView = pageflow.ReferenceInputView.extend({ | ||
getTarget: function() { | ||
return null; | ||
} | ||
}); | ||
|
||
describe('with disabled option', function() { | ||
it('sets disabled attributes on buttons', function() { | ||
var view = new TestView({ | ||
model: new Model(), | ||
propertyName: 'some_id', | ||
disabled: true | ||
}); | ||
|
||
view.render(); | ||
|
||
expect(view.ui.buttons).to.have.$attr('disabled'); | ||
}); | ||
}); | ||
}); |