I\'m trying to Factory a Post associated with a Vote. So that Post.votes would generate the Vote\'s that are associated with it.
I was hoping someone would spot why this wouldn\'t work. I am getting an error thats being called because the attributes I specify with开发者_开发问答 Factory_Girl are not being applied to the stub b
I am using cucumber and factory_girl in a rails 2.3.9 project. Here is one of the givens in one of my features.
I have following models in my app: class Game < ActiveRecord::Base has_many :players has_many :villages, :through => :players
I have 2 Mo开发者_StackOverflowdels: # user.rb class User < ActiveRecord::Base has_one :profile, :dependent => :destroy
My users_controller.rb # GET /users/1/edit def edit @user = current_user #@user = User.find(params[:id]) end
I have this kind of relation: class Article < ActiveRecord::Base has_many :comments end class Comment < ActiveRecord::Base
I have the following shoulda set up which I would like to use factory_girl to have the fake model available in other specs.
I\'m being held up implementing tests with a slight confusion. With User.create I can create and s开发者_如何学JAVAave in multiple tests:
I\'m using this sort of code in my code in my Unit tests. test \"should be开发者_开发问答 awesome\" do