Skip to content

Instantly share code, notes, and snippets.

@ksin
Last active August 29, 2015 14:10
Show Gist options
  • Save ksin/8f5c0e63f9b1161ea27d to your computer and use it in GitHub Desktop.
Save ksin/8f5c0e63f9b1161ea27d to your computer and use it in GitHub Desktop.
Integration test
import Ember from 'ember';
import { test } from 'ember-qunit';
import startApp from '../helpers/start-app';
import {yoloInstagramRecentMediaJson} from './fixtures/instagram-json';
var App;
module('Integration: Instagram Search', {
setup: function() {
App = startApp();
App.register('instagram-api-client:main', Ember.Object.extend({
recentMediaForTag: function(tag, options) {
return Ember.RSVP.resolve(yoloInstagramRecentMediaJson);
}
}));
},
teardown: function() {
Ember.run(App, App.destroy);
}
});
test('Searches Instagram for images', function() {
expect(2);
visit('/');
andThen(function() {
equal(find('#title').text(), "Instagram hashtag image search", "Title is on homepage.");
});
fillIn('input.search-field', 'yolo');
fillIn('input.count', 16);
click('button');
andThen(function() {
equal(find('img').length, 16, "Sixteen images are found.");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment