Browse files

The Setup

  • Loading branch information...
1 parent 6cae9ed commit 69b5dc6f028a2c0bac841cb85a6c9043eb1b4357 @arailsdemo committed Jan 29, 2011
Showing with 22 additions and 0 deletions.
  1. +11 −0 spec/factories/post.rb
  2. +11 −0 spec/integration/user/post_viewing_spec.rb
View
11 spec/factories/post.rb
@@ -0,0 +1,11 @@
+Factory.sequence :seq do |n|
+ n
+end
+
+FactoryGirl.define do
+ factory :post do
+ sequence(:title) { |n| "#{n} Zombies!"}
+ add_attribute(:sequence) { Factory.next(:seq) }
+ status 'published'
+ end
+end
View
11 spec/integration/user/post_viewing_spec.rb
@@ -0,0 +1,11 @@
+require "spec_helper"
+
+describe "Meet Capybara (non admin).", :integration => true do
+ context "He's crawling around our app." do
+ let(:post1){ @post1 ||= Factory(:post) }
+ let(:post2){ @post2 ||= Factory(:post) }
+
+ before { post1; post2 }
+
+ end
+end

0 comments on commit 69b5dc6

Please sign in to comment.