Last active
August 29, 2015 14:10
-
-
Save ksin/8f5c0e63f9b1161ea27d to your computer and use it in GitHub Desktop.
Integration test
This file contains 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'; | |
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