user_agent.rs
use pavex::http::header::{ToStrError, USER_AGENT};
use pavex::request::RequestHead;
use pavex::response::Response;
pub enum UserAgent {
Unknown,
Known(String),
}
user_agent.rs
use pavex::http::header::{ToStrError, USER_AGENT};
use pavex::request::RequestHead;
use pavex::response::Response;
pub enum UserAgent {
Unknown,
Known(String),
}
Verifying my Blockstack ID is secured with the address 12TiEPhFGe5C9nKQwckDnzjV7jY2zMk7T6 https://explorer.blockstack.org/address/12TiEPhFGe5C9nKQwckDnzjV7jY2zMk7T6 |
import Ember from 'ember'; | |
var PromiseObject = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin); | |
export default Ember.Component.extend({ | |
proposal: null, | |
participant: null, | |
// previousSupport: [], | |
actions: { |
// app/templates/components/support-button.hbs | |
<button {{action 'toggleSupport' proposal session.me}}> | |
// app/components/support-button.js | |
export default Ember.Component.extend({ | |
actions: { | |
toggleSupport: function(proposal, participant){ | |
return proposal.toggleSupportBy(participant); | |
} | |
} |
//tests/unit/models/proposal.js | |
/* jshint expr:true */ | |
import { | |
describe, | |
describeModule, | |
it, | |
beforeEach, | |
afterEach | |
} from 'ember-mocha'; |
var get = Ember.get, set = Ember.set; | |
var models, env; | |
var responses, fakeServer; | |
module('integration/specs/errors', { | |
setup: function() { | |
fakeServer = stubServer(); | |
responses = { | |
post_errors: { |
Failure/Error: user = login_as_tenant | |
Capybara::Poltergeist::JavascriptError: | |
One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details). | |
TypeError: 'undefined' is not an object (evaluating 'this.data[0].date') | |
TypeError: 'undefined' is not an object (evaluating 'this.data[0].date') | |
at http://127.0.0.1:53574/assets/application.js:24516 | |
at http://127.0.0.1:53574/assets/application.js:24507 in UserShowTempChartSvg |
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 |
language: node_js | |
node_js: | |
- "0.11" | |
before_script: | |
- npm install bower | |
- bower install |
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 |