Skip to content

Instantly share code, notes, and snippets.

View oliverbarnes's full-sized avatar
💭
🦀 🚅

Oliver Azevedo Barnes oliverbarnes

💭
🦀 🚅
View GitHub Profile
@oliverbarnes
oliverbarnes / failure output
Created November 18, 2014 23:49
Timeout failure on ember-cli-mocha test
not ok 6 PhantomJS 1.9 - Posting an initiative before posting "before each" hook
---
message: >
timeout of 2000ms exceeded
Log: >
...
not ok 7 PhantomJS 1.9 - Posting an initiative when the initiative is valid "before each" hook
---
message: >
timeout of 2000ms exceeded
@oliverbarnes
oliverbarnes / .travis-for-ember-cli.yml
Last active August 29, 2015 14:04
travis.yml for ember cli app
language: node_js
node_js:
- "0.11"
before_script:
- npm install bower
- bower install
@oliverbarnes
oliverbarnes / ember-cli-bdd-tutorial-part-I
Last active August 29, 2015 14:04
Learning Behavior-Driven Development with Ember CLI - part I
This tutorial walks through [BDD](http://en.wikipedia.org/wiki/Behavior-driven_development)'ing a feature with [Ember CLI](http://iamstef.net/ember-cli/), [Mocha](http://visionmedia.github.io/mocha/) and [Chai](http://chaijs.com).
I'm writing it as I learn [Emberjs](http://emberjs.com), its way of doing things and its toolset, and try to adapt my usual workflow coming from Ruby. It's meant as an initial guide for the [RGSoC](http://railsgirlssummerofcode.org) [team](http://rghelsinki2014.tumblr.com) working on [Participate](https://github.com/oliverbarnes/participate-frontend). Hopefully this post will be helpful to others learning Ember as well, and even better, invite people to show how they're doing things themselves in the comments.
The feature I'll build here in baby-steps will be *Posting a New Initiative*. In Participate, a user can post proposals for civic initiatives, to which other users can then suggest changes, and then vote on.
This first installment will involve nothing but filling out a si
@oliverbarnes
oliverbarnes / ember-cli-bdd-tute.md
Last active August 29, 2015 14:04
Draft for tutorial on bdd-ing an ember-cli feature

Participate is being worked on by a great team in Helsinki as part of this year's Rails Girls Summer of Code!

The front-end application is being built with Emberjs and the brand-spanking-new Ember CLI, and we're all getting a crash course on both.

This tutorial walks through building a simplistic feature in Ember following Behavior-Driven Development as much as possible.

It's meant as a sample workflow for the RGSOC team, new to BDD itself, and as a possibly useful example to others grokking bdd-ing with Ember, like myself. It comes from my attempts to port my usual workflow in Ruby.

In this first installment, I'll create a very simple Initiative with just a title and a description.

E:\RG\projects\participate>bundle exec rackup
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
For a better pry experience, please use ansicon: http://adoxa.3eeweb.com/ansicon
/
C:/Ruby200/lib/ruby/gems/2.0.0/gems/representable-1.7.5/lib/representable/hash/c
ollection.rb:1:in `<top (required)>': uninitialized constant Representable (Name
Error)
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/representable-1.7.5/lib/represe
ntable/json/collection.rb:1:in `require'
@oliverbarnes
oliverbarnes / load_libraries_spec.rb
Created May 8, 2014 01:59
Trying to test loading of libs
ENV["RAILS_ENV"] ||= 'development'
require 'rubygems'
# Set up gems listed in the Gemfile.
require 'bundler/setup' if File.exists?(File.expand_path('../Gemfile', __FILE__))
# Ensure Builder is loaded
require 'active_support/builder' unless defined?(Builder)
@oliverbarnes
oliverbarnes / load_libraries_spec.rb
Created May 8, 2014 01:57
trying to test loading of libs
ENV["RAILS_ENV"] ||= 'production'
require 'rubygems'
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __FILE__)
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
# Ensure Builder is loaded
require 'active_support/builder' unless defined?(Builder)
App.Graph = Ember.Object.extend
series: null
initialize: (data)->
series = [{ data: data }]
@set('series', series)
App.GraphController = Ember.ObjectController.extend
@oliverbarnes
oliverbarnes / testing_qunit_setup.coffee
Last active December 22, 2015 11:29 — forked from anonymous/test_and_error.coffee
Initial integration test to make sure I have basic setup working correctly. Following this tutorial: http://ianpetzer.wordpress.com/2013/06/14/getting-started-with-integration-testing-ember-js-using-ember-testing-and-qunit-rails/ Using Rails 4
exists = (selector) ->
!!find(selector).length
module "Ember.js Library",
setup: ->
Ember.run App, App.advanceReadiness
teardown: ->
App.reset()
1) User account deletion #destroy removes invitations to the user
Failure/Error: lambda {
result should have been changed by -1, but was changed by 0
# ./spec/models/user_spec.rb:569:in `block (4 levels) in <top (required)>'
2) User account deletion #destroy removes invitations from the user
Failure/Error: lambda {
result should have been changed by -1, but was changed by 0
# ./spec/models/user_spec.rb:562:in `block (4 levels) in <top (required)>'