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 request = require('supertest') | |
| var Post = require('../../models/post') | |
| describe('Posts Controller', function() { | |
| describe('index', function() { | |
| it('retrieves posts', function(done) { | |
| new Post({ | |
| title: 'Test Post', | |
| content: 'Test Content' | |
| }).save() |
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 googlePlacesInitialize() { | |
| var inputs; | |
| inputs = $('input[data-google-places]'); | |
| return $.each(inputs, function() { | |
| return new google.maps.places.Autocomplete(this, { | |
| types: ['geocode'], | |
| componentRestrictions: { | |
| country: 'us' | |
| } | |
| }); |
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
| { | |
| "comment": { | |
| "id": 11, | |
| "content": "this is my comment", | |
| "post_id": 2 | |
| } | |
| } |
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
| import Ember from 'ember'; | |
| export default Ember.ObjectController.extend({ | |
| actions: { | |
| create: function(post) { | |
| var self = this; | |
| var comment = this.store.createRecord('comment', { | |
| post: post, | |
| content: this.get('content') | |
| }); |
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
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| searchText: null, | |
| searchResults: function() { | |
| var searchText = this.get('searchText'); | |
| if (!searchText) { return; } | |
| return this.store.find('post', {name: searchText}); |
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
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| searchText: null, | |
| searchResults: [], | |
| updateResults: function() { | |
| var self = this; | |
| var searchText = self.get('searchText'); |
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
| import Ember from 'ember'; | |
| export default Ember.Controller.extend(Ember.Validations.Mixin, { | |
| errors: [], | |
| validations: { | |
| email: { | |
| presence: true, | |
| format: { | |
| with: /^[\w+\-.]+@[a-z\d\-.]+\.[a-z]+$/i, |
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
| import { test, moduleForComponent } from 'ember-qunit'; | |
| moduleForComponent('gravatar-image', 'GravatarImageComponent', { | |
| }); | |
| test('it renders with size and e-mail', function() { | |
| var component = this.subject(); | |
| Ember.run(function(){ | |
| component.set('size', 400); |
NewerOlder