o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1352131995.334966: @value"Õ#{I" class:EFI"ProcessedAsset;FI"logical_path;FI".organization_dashboard_controller_spec.js;FI" pathname;FI"s/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/organization_dashboard_controller_spec.js.coffee;FI"content_type;FI"application/javascript;FI" mtime;FI"2012-11-02T20:51:55-04:00;FI" length;FiI" digest;F"%0d31b3a66a3e3683a352207941ba1bd5I" 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"%99331fb73ff539031b865c5cc14bec79I"required_paths;F[I"l/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/jquery-rails-2.1.3/vendor/assets/javascripts/jquery.js;FI"l/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/sinon-rails-1.4.2.1/vendor/assets/javascripts/sinon.js;FI"d/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/sinon-chai/sinon-chai.js;FI"Y/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/templates/tabs.jst.ejs;FI"X/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/spec_helper.js.coffee;FI"]/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/underscore-min.js;FI"ƒ/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/tooltip.js;FI"ƒ/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/popover.js;FI"z/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/organization_dashboard_controller.js;FI"s/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/organization_dashboard_controller_spec.js.coffee;FI"dependency_paths;F[{I" path;FI"s/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/organization_dashboard_controller_spec.js.coffee;FI" mtime;FI"2012-11-02T20:51:55-04:00;FI" digest;F"%8a8b73c213374a532344e24c71eecdbe{I" path;FI"L/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/templates;FI" mtime;FI"2012-10-11T16:01:17-04:00;FI" digest;F"%3e529859892b429d7f86a1ed01d51e66{I" path;FI"X/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/spec_helper.js.coffee;FI" mtime;FI"2012-10-11T16:01:17-04:00;FI" digest;F"%7ae4f8132c6026d65d0a13f1b18cd8ca{I" path;FI"l/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/jquery-rails-2.1.3/vendor/assets/javascripts/jquery.js;FI" mtime;FI"2012-10-22T11:21:58-04:00;FI" digest;F"%43cde21914c09fcf7ee10c3cf91cb905{I" path;FI"l/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/sinon-rails-1.4.2.1/vendor/assets/javascripts/sinon.js;FI" mtime;FI"2012-10-18T14:40:10-04:00;FI" digest;F"%3975db7dd0993f44f0b2bf44c15e8353{I" path;FI"d/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/sinon-chai/sinon-chai.js;FI" mtime;FI"2012-10-11T16:01:17-04:00;FI" digest;F"%84a21bfc872a9ee86eb35f36da448409{I" path;FI"Y/Users/adamdoeler/Sites/bigbang/woople-theme/spec/javascripts/templates/tabs.jst.ejs;FI" mtime;FI"2012-10-11T16:01:17-04:00;FI" digest;F"%eef7087b445699495b494635f70b5694{I" path;FI"]/Users/adamdoeler/Sites/bigbang/woople-theme/vendor/assets/javascripts/underscore-min.js;FI" mtime;FI"2012-10-22T11:15:49-04:00;FI" digest;F"%12298b09dd0de40b9214c47ab0401335{I" path;FI"ƒ/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/tooltip.js;FI" mtime;FI"2012-10-18T14:39:53-04:00;FI" digest;F"%ae6c376f04d9ced1fdb3ca135a773bd3{I" path;FI"ƒ/Users/adamdoeler/.rvm/gems/ruby-1.9.3-p194/gems/less-rails-bootstrap-2.0.13/vendor/assets/javascripts/twitter/bootstrap/popover.js;FI" mtime;FI"2012-10-18T14:39:53-04:00;FI" digest;F"%f25f8d0969385c068ca9a76fa380e822{I" path;FI"z/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/organization_dashboard_controller.js;FI" mtime;FI"2012-11-05T11:12:57-05:00;FI" digest;F"%ae638d30f173f8cbb11104f71a0edc93I" _version;F"%9f3b95dd7ea3030dc35985c0a8020862