Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2009 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/170472 to your computer and use it in GitHub Desktop.
Save anonymous/170472 to your computer and use it in GitHub Desktop.
describe 'Creating a Sheet...'
before
valid_grid_values = {
_id: 'baseball',
format: 'grid'
};
fill_out = function (form, values, overrides) {
form.setValues( xtend({}, values, overrides) );
};
// fill_out(form, valid_grid_values, {_id: ''});
end
setup_page(1, function () {
pane = new Ext.ux.NewSheet()
area = display(pane, '#new-sheet')
form = pane.items.get(0).getForm();
^
.., must specify a unique sheet id ...
.., in an input box
area.should.have_tag 'input#_id_field'
... thats unique
Current.sheets.should.receive('has', 'twice').with_args('Taken').and_return(true)
form.set('_id', 'Taken').should_not.be_valid
// cant mock w/ diff args, so stub now
Current.sheets.stub('has').and_return(false)
form.set('_id', 'New').should.be_valid
... its required
form.set('_id', '').should_not.be_valid
... must specify whether its a `text` or `grid` sheet ...
.., in a radio box
area.should.have_radio 'format', 'grid', 'text'
^
^
^
// # Syntax ideaz #
// alt mock syntax ⌥ 1
// current.sheets ¡has('Toad') -> true
// real elipses ⌥ ;
// … it should
// better closing
// ????
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment