o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1357227532.2965472: @value"=${I" class:EFI"ProcessedAsset;FI"logical_path;FI".organization_dashboard_controller_spec.js;TI" pathname;FI"s/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/organization_dashboard_controller_spec.js.coffee;TI"content_type;FI"application/javascript;FI" mtime;FI"2012-11-02T20:51:55-04:00;FI" length;FiI" digest;F"%7b86d608ea34526d5e4fcfd7fe4b7902I" source;FI"(function() { describe('OrganizationDashboardController', function() { beforeEach(function() { $('body').html('
'); return this.sut = new OrganizationDashboardController(); }); describe('init', function() { return it('sets up the listeners', function() { var callback, listenersStub; callback = { reminderCallback: 'foo' }; listenersStub = sinon.stub(this.sut, 'setupListeners'); this.sut.init(callback); return expect(listenersStub).to.have.been.calledOnce; }); }); describe('setupListeners', function() { beforeEach(function() { this.mobileStub = sinon.stub(this.sut, 'mobileSetup'); this.buttonsStub = sinon.stub(this.sut, 'bindReminderButtons'); return this.sut.setupListeners(); }); it('sets up mobile', function() { return expect(this.mobileStub).to.have.been.calledOnce; }); return it('binds reminder buttons', function() { return expect(this.buttonsStub).to.have.been.calledOnce; }); }); describe('mobileSetup', function() { it('switches the button when on a small screen', function() { sinon.stub(this.sut, 'isPhone').returns(true); this.sut.mobileSetup(); return expect($('#organization-accounts button').hasClass('btn-large')).to.be["true"]; }); return it('does not switch the button on other screens', function() { sinon.stub(this.sut, 'isPhone').returns(false); sinon.stub(this.sut, 'createPopover'); this.sut.mobileSetup(); return expect($('#organization-accounts button').hasClass('btn-large')).to.be["false"]; }); }); describe('bindReminderButtons', function() { before(function() { return this.clock = sinon.useFakeTimers(); }); after(function() { return this.clock.restore(); }); return it('binds the callback to the click event', function() { var callbackStub; sinon.stub(this.sut, 'createPopover'); this.sut.init(); callbackStub = sinon.stub(this.sut, 'sendReminder'); $('#organization-accounts .remind-column .btn').first().click(); this.clock.tick(300); return expect(callbackStub).to.have.been.calledOnce; }); }); describe('sendReminder', function() { beforeEach(function() { return this.ajax = sinon.stub(jQuery, 'ajax'); }); afterEach(function() { return this.ajax.restore(); }); it('tells the button to change when the reminder is successful', function() { var button, callback, url; url = '/reminder'; button = $('#organization-accounts button').first(); callback = sinon.stub(this.sut, 'changeButton'); this.ajax({ success: callback }); this.ajax.yieldTo('success'); this.sut.sendReminder(url, button); return expect(callback).to.be.called; }); return it('tells the user something went wrong', function() { var button, callback, url; url = '/reminder'; button = $('#organization-accounts button').first(); callback = sinon.stub(this.sut, 'remindError'); this.ajax({ error: callback }); this.ajax.yieldTo('error'); this.sut.sendReminder(url, button); return expect(callback).to.be.called; }); }); describe('log', function() { beforeEach(function() { return sinon.stub(this.sut, 'setupListeners'); }); it('writes to the console when debugging is enabled', function() { var stub; stub = sinon.stub(console, 'log').returns(true); this.sut.init(true); expect(stub).to.have.been.calledOnce; return stub.restore(); }); return it('does not write to the console when debugging is disabled', function() { var stub; stub = sinon.stub(console, 'log').returns(true); this.sut.init(false); expect(stub).to.not.have.been.called; return stub.restore(); }); }); return describe('isPhone', function() { it('returns true when the window width is phone sized', function() { var windowStub; windowStub = sinon.stub(this.sut, "windowWidth").returns(480); expect(this.sut.isPhone()).to.be["true"]; windowStub.restore(); windowStub = sinon.stub(this.sut, "windowWidth").returns(280); expect(this.sut.isPhone()).to.be["true"]; return windowStub.restore(); }); return it('returns false when the window is not phone sized', function() { var windowStub; windowStub = sinon.stub(this.sut, 'windowWidth').returns(1000); expect(this.sut.isPhone()).to.be["false"]; windowStub.restore(); windowStub = sinon.stub(this.sut, 'windowWidth').returns(481); return expect(this.sut.isPhone()).to.be["false"]; }); }); }); }).call(this); ;TI"dependency_digest;F"%3f9707d9c6474f4a910f67beb7a60189I"required_paths;F[I"y/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/jquery-rails-2.1.3/vendor/assets/javascripts/jquery.js;TI"y/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/sinon-rails-1.4.2.1/vendor/assets/javascripts/sinon.js;TI"d/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/sinon-chai/sinon-chai.js;TI"Y/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/templates/tabs.jst.ejs;TI"X/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/spec_helper.js.coffee;TI"]/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/underscore-min.js;TI"/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/tooltip.js;TI"/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/popover.js;TI"z/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/organization_dashboard_controller.js;TI"s/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/organization_dashboard_controller_spec.js.coffee;TI"dependency_paths;F[{I" path;FI"s/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/organization_dashboard_controller_spec.js.coffee;TI" mtime;FI"2012-11-02T20:51:55-04:00;FI" digest;F"%80f593328a9e308db386cd3698bac8ab{I" path;FI"L/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/templates;TI" mtime;FI"2012-10-11T16:01:17-04:00;FI" digest;F"%f6029330714acec9fa4e55e351e699fe{I" path;FI"X/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/spec_helper.js.coffee;TI" mtime;FI"2012-11-15T14:33:57-05:00;FI" digest;F"%67b22f2939837ac46cf4ee450b9ff01c{I" path;FI"y/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/jquery-rails-2.1.3/vendor/assets/javascripts/jquery.js;TI" mtime;FI"2012-11-23T13:58:18-05:00;FI" digest;F"%8a9d9a628fa634d048c33edeb256d188{I" path;FI"y/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/sinon-rails-1.4.2.1/vendor/assets/javascripts/sinon.js;TI" mtime;FI"2012-11-23T13:58:35-05:00;FI" digest;F"%c24806bd84daee815304e7dfb3a42760{I" path;FI"d/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/sinon-chai/sinon-chai.js;TI" mtime;FI"2012-10-11T16:01:17-04:00;FI" digest;F"%50df106c8b2be6544750327b582cca96{I" path;FI"Y/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/templates/tabs.jst.ejs;TI" mtime;FI"2012-10-11T16:01:17-04:00;FI" digest;F"%07ec6626d1af7ac92590b64448f375b1{I" path;FI"]/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/underscore-min.js;TI" mtime;FI"2012-10-22T11:15:49-04:00;FI" digest;F"%649f9dcad52b6a77490e7b2f4087e3fe{I" path;FI"/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/tooltip.js;TI" mtime;FI"2012-11-23T13:58:22-05:00;FI" digest;F"%140fc50b2ba857b9d6a62778027f532f{I" path;FI"/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p327@woople-theme/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/popover.js;TI" mtime;FI"2012-11-23T13:58:22-05:00;FI" digest;F"%aebcefe767510168237f33373a693d5a{I" path;FI"z/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/organization_dashboard_controller.js;TI" mtime;FI"2012-11-05T13:26:15-05:00;FI" digest;F"%9f0d9e04b34f1c280bdc88b320a95819I" _version;F"%6776f581a4329e299531e1d52aa59832