This file contains hidden or 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
| <?php | |
| I\see($user)->is('User'); | |
| I\see($string)->equals('hello'); | |
| I\see($user_names)->contains('davert'); | |
| I\see("Hello world")->contains('Hello'); | |
| I\expect(function() { | |
| $user->save(); | |
| })->throwsException('NotAllowedException'); |
This file contains hidden or 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
| <?php | |
| $I = new TestGuy($scenario); | |
| $I->wantTo('perform actions and see result'); | |
| $I->amOnPage('/posts'); | |
| $I->see('All Posts'); | |
| $I->click('Add new post'); | |
| $I->fillField('#title', 'Hello world again'); | |
| $I->fillField('Body:', 'And greetings for all'); | |
| $I->click('Submit'); | |
| $I->see('All Posts'); |
This file contains hidden or 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
| <?php | |
| // resolving naming collisions with aliases | |
| $I->seeInDatabase() | |
| $I->click_usingSelenium2() | |
| $I->click_Selenium2() | |
| $I->seeInDatabase() // default | |
| $I->seeInDatabase_usingDb() // optional | |
| $I->seeInDatabase_usingSecondDb() // for extended class | |
| $I->seeInDatabase_SecondDb() //shortcut for _usingSecondDb |
This file contains hidden or 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
| var mails = new MailCollection(); | |
| var user = new User(); | |
| var mailsView = new MailCollectionView({collection: mails}); | |
| var form = new MailFormView({}); | |
| user.fetch({success: function() { | |
| mails.fetch({success: function() { | |
| mailsView.render(); | |
| }}); | |
| }}); |
This file contains hidden or 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
| // views | |
| SignInView = Backbone.View.extend({ | |
| el: $('body'), | |
| template: _.template($('#signin-template').html()), | |
| render: function() { | |
| this.$el.html(this.template()); | |
| } | |
| }); |
This file contains hidden or 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
| Mail = Backbone.Model.extend({ | |
| domain: function() { | |
| return "@mailican.com"; | |
| }, | |
| local: function() { | |
| return user.get('name')+"."+this.get('alias'); | |
| } | |
| }); |
This file contains hidden or 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
| User = Backbone.Model.extend({ | |
| fetch: function() { | |
| var xhr = { | |
| url: 'http://mailican.com/api/user.json', | |
| method: 'GET', | |
| async: true, | |
| contentType: 'json' | |
| }; | |
| var self = this; | |
| kango.xhr.send(xhr, function(data) { |
This file contains hidden or 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
| KangoAPI.onReady(function() { | |
| $('html').delegate('#visit', 'click', function() { | |
| kango.browser.tabs.create({url:'http://mailican.com/'}); | |
| }); | |
| $('html').delegate('#signin', 'click', function() { | |
| kango.browser.tabs.create({url:'http://mailican.com/signin'}); | |
| }); |
This file contains hidden or 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
| <head> | |
| <script type="text/javascript" src="kango-ui/kango_api.js"></script> | |
| <script type="text/javascript" src="jquery-1.9.1.min.js"></script> | |
| <script type="text/javascript" src="underscore-min.js"></script> | |
| <script type="text/javascript" src="backbone-min.js"></script> | |
| <script type="text/javascript" src="popup.js"></script> | |
| <link rel="stylesheet" href="foundation.min.css"> | |
| <link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'> |
This file contains hidden or 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
| function Mailican() { | |
| var self = this; | |
| kango.ui.browserButton.setPopup({url:'popup.html', width: 400, height: 400 }); | |
| kango.ui.browserButton.addEventListener(kango.ui.browserButton.event.COMMAND, function(){self._onCommand();}); | |
| } | |
| Mailican.prototype = { | |
| _onCommand: function() { | |
| } | |
| }; |