Summary Where City has many Locations (HABTM association), create a child record like this: a = Location.create(:name=>\'Site 1\', :city => City.create(:name=>\'A City\'))
Previously in Factory girl, we could define sequences like so: # /spec/factories.rb FactoryGirl.define do
I\'m working on a rails project using, cucumber, capybara and factory girl, and recently updated from rails 3.0.3 to rails 3.0.5, deleted my Gemfile.lock, run the bundle install command, and it appear
I am trying to test an associated document for a subscription service. Each subscription is embedded in an account and references a plan. Below is the various bits of code:
I have an spec like so: require \'spec_helper\' describe IncomingMailsController do include Devise开发者_运维百科::TestHelpers
I have the following models: Users (id) Project (id, name) Roles (id, title) Permissions (user_id, role_id, project_id)
can someone provide an example or point me to where I can learn how to do Factory Girl nested model associations?
I\'m trying to populate some fake data into a factory using the Faker gem: Factory.define :user do |user|
I have a problem where after_build don\'t seem to trigger after after the actual build. As the example below illustrates, the after_build shouldn\'t build a second tail when called through Factory.bui
I was reading through the documentation of Factory Girl and came across this code block. #The behavior of the association method varies depending on the build strategy used for the parent object.