Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hangar-factory-girl

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hangar-factory-girl - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

11

hangar-factory-girl.js

@@ -18,3 +18,3 @@ var url = require('url');

hangarFactoryGirl.prototype = {
create: function(name, attributes) {
create: function(name, attributes, include) {
this._name = name;

@@ -24,3 +24,4 @@ this._path = '/' + this.pluralizeName();

this.formatData(attributes);
this.formatData(attributes, include);
return this.request();

@@ -45,3 +46,3 @@ },

},
formatData: function(attributes) {
formatData: function(attributes, include) {
this._data = {};

@@ -52,2 +53,6 @@

}
if (include !== undefined) {
this._data["include"] = include;
}
},

@@ -54,0 +59,0 @@ request: function() {

{
"name": "hangar-factory-girl",
"version": "0.1.2",
"version": "0.1.3",
"description": "Library to use Hangar with protractor",

@@ -5,0 +5,0 @@ "main": "hangar-factory-girl.js",

@@ -5,4 +5,4 @@ # Hangar Factory Girl

This is only usefull with [Hangar](https://github.com/faradayio/hangar).
More info about hangar: http://faraday.io/2014/09/24/hangar-using-factorygirl-factories-from-your-frontend-tests
This is only useful with [Hangar](https://github.com/faradayio/hangar).
Read more about hanger [here](hangar: http://www.faraday.io/blog/hangar-use-your-factorygirl-factories-for-your-front-end-tests).

@@ -33,3 +33,15 @@ ## Installation

it("does something", function() {
/*
* method create
* 1st param is factory's name
* 2nd param is factory's attributes that you want to override
* 3rd param is include option when you want model to return it's association
*/
var user = factory.create('user');
/*
* method build
* 1st param is factory's name
* 2nd param is factory's attributes that you want to override
*/
var comment = factory.build('comment', { user_id: user.id });

@@ -36,0 +48,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc