Skip to content

Instantly share code, notes, and snippets.

@irissilvermoon
Created April 24, 2013 03:25
Show Gist options
  • Save irissilvermoon/5449368 to your computer and use it in GitHub Desktop.
Save irissilvermoon/5449368 to your computer and use it in GitHub Desktop.
#factory:
FactoryGirl.define do
factory :user do
email "wishlist@example.com"
username "User"
password "password"
password_confirmation "password"
factory :confirmed_user do
sequence(:email) { |n| "wishlist#{n}@example.com" }
after_create do |user|
user.confirm!
end
end
end
end
#test:
require 'spec_helper'
feature 'User Profiles' do
let!(:user) { Factory(:confirmed_user) }
before do
sign_in_as!(user)
visit '/'
click_link 'Profile'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment