create user using factory in ruby on rails
factories.rb:-
-------------------
FactoryGirl.define do
factory :user do
email 'user@example.com'
password 'welcome'
end
end
user_spec.rb:--------------------
FactoryGirl.define do
factory :user do
email 'user@example.com'
password 'welcome'
end
end
---------------------
require 'spec_helper'
describe User do
it 'has a valid factory' do
FactoryGirl.create :user
end
end
Comments
Post a Comment