yay, finally a passing spec

This commit is contained in:
Sven Fuchs 2012-06-26 03:56:22 +02:00
parent daed80916b
commit 932219f377
7 changed files with 73 additions and 2430 deletions

View File

@ -56,6 +56,7 @@ input 'assets/javascripts/spec' do
vendor/jasmine.js
vendor/jasmine-html.js
vendor/jasmine-runner.js
vendor/sinon.js
)
concat files, 'specs/vendor.js'
end

View File

@ -1,10 +1,13 @@
describe 'Foo', ->
it 'bar', ->
link = $($('#repositories a.slug')[0])
console.log $('body').html()
# link.attr('href').should.equal '#/travis-ci/travis-core'
beforeEach ->
createApp()
waitFor repositoriesRendered
it 'bar', ->
link = $($('#repositories a.slug')[0])
# link.attr('href').should.equal '#/travis-ci/travis-core'
href = $('#repositories a.slug').attr('href')
expect(href).toEqual '#/travis-ci/travis-core'
it 'bar', ->
href = $('#repositories a.slug').attr('href')
expect(href).toEqual '#/travis-ci/travis-core'

View File

@ -1,12 +1,27 @@
minispade.require 'app'
beforeEach ->
@after = (time, func) ->
waits(time)
jasmine.getEnv().currentSpec.runs(func)
@once = (condition, func) ->
waitsFor(condition)
jasmine.getEnv().currentSpec.runs(func)
@reset = ->
Travis.app.destroy() if Travis.app
$('body #content').empty()
Em.run ->
Travis.app = Travis.App.create()
Travis.app.set('rootElement', '#content')
Travis.app.initialize()
afterEach ->
Travis.app.destroy()
@createApp = ->
Travis.app = Travis.App.create()
Travis.app.set('rootElement', '#content')
Travis.app.initialize()
@waitFor = waitsFor
@repositoriesRendered = ->
$('#repositories li').length > 0
beforeEach ->
reset()

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,19 @@
(function() {
describe('Foo', function() {
beforeEach(function() {
createApp();
return waitFor(repositoriesRendered);
});
it('bar', function() {
var link;
link = $($('#repositories a.slug')[0]);
return console.log($('body').html());
var href;
href = $('#repositories a.slug').attr('href');
return expect(href).toEqual('#/travis-ci/travis-core');
});
return it('bar', function() {
var link;
return link = $($('#repositories a.slug')[0]);
var href;
href = $('#repositories a.slug').attr('href');
return expect(href).toEqual('#/travis-ci/travis-core');
});
});
@ -17,17 +22,37 @@
minispade.require('app');
beforeEach(function() {
$('body #content').empty();
return Em.run(function() {
Travis.app = Travis.App.create();
Travis.app.set('rootElement', '#content');
return Travis.app.initialize();
});
});
this.after = function(time, func) {
waits(time);
return jasmine.getEnv().currentSpec.runs(func);
};
afterEach(function() {
return Travis.app.destroy();
this.once = function(condition, func) {
waitsFor(condition);
return jasmine.getEnv().currentSpec.runs(func);
};
this.reset = function() {
if (Travis.app) {
Travis.app.destroy();
}
return $('body #content').empty();
};
this.createApp = function() {
Travis.app = Travis.App.create();
Travis.app.set('rootElement', '#content');
return Travis.app.initialize();
};
this.waitFor = waitsFor;
this.repositoriesRendered = function() {
return $('#repositories li').length > 0;
};
beforeEach(function() {
return reset();
});
}).call(this);

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,7 @@ body {
#left, #main {
float: left;
height: 500px;
}
#left {