aboutsummaryrefslogtreecommitdiffstats
path: root/features
diff options
context:
space:
mode:
Diffstat (limited to 'features')
-rw-r--r--features/category.feature2
-rw-r--r--features/support/factories/blog_comments.rb2
-rw-r--r--features/support/factories/blog_posts.rb2
-rw-r--r--features/support/step_definitions/category_steps.rb8
-rw-r--r--features/support/step_definitions/tags_steps.rb4
5 files changed, 9 insertions, 9 deletions
diff --git a/features/category.feature b/features/category.feature
index 14ec93e..6af1075 100644
--- a/features/category.feature
+++ b/features/category.feature
@@ -19,5 +19,5 @@ Feature: Blog Post Categories
And I press "Save"
Then there should be 1 blog post
- And the blog post should have "1" category
+ And the blog post should have 1 category
And the blog post should have the category "Videos" \ No newline at end of file
diff --git a/features/support/factories/blog_comments.rb b/features/support/factories/blog_comments.rb
index af364be..9405c42 100644
--- a/features/support/factories/blog_comments.rb
+++ b/features/support/factories/blog_comments.rb
@@ -4,5 +4,5 @@ Factory.define(:blog_comment) do |f|
f.name "Joe Commenter"
f.sequence(:email) { |n| "person#{n}@example.com" }
f.body "Which one is the best for picking up new shoes?"
- f.association :post
+ f.association :post, :factory => :blog_post
end
diff --git a/features/support/factories/blog_posts.rb b/features/support/factories/blog_posts.rb
index 33f6b93..4584fec 100644
--- a/features/support/factories/blog_posts.rb
+++ b/features/support/factories/blog_posts.rb
@@ -1,6 +1,6 @@
require 'factory_girl'
-Factory.define(:post, :class => BlogPost) do |f|
+Factory.define(:blog_post, :class => BlogPost) do |f|
f.sequence(:title) { |n| "Top #{n} Shopping Centers in Chicago" }
f.body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it."
f.draft false
diff --git a/features/support/step_definitions/category_steps.rb b/features/support/step_definitions/category_steps.rb
index 31176b4..891b5c0 100644
--- a/features/support/step_definitions/category_steps.rb
+++ b/features/support/step_definitions/category_steps.rb
@@ -1,11 +1,11 @@
Given /^there is a category titled "([^"]*)"$/ do |title|
- @category = Factory(:blog_category, :title => title)
+ @category = Factory.create(:blog_category, :title => title)
end
-Then /^the blog post should have "([^"]*)" category$/ do |num_category|
- BlogPost.last.categories.count.should == num_category
+Then /^the blog post should have ([\d]*) categor[yies]{1,3}$/ do |num_category|
+ BlogPost.last.categories.count.should == num_category.to_i
end
-Then /^the blog post should have the category "([^"]*)"$/ do |category|
+Then /^the blog post should have the category "([^"]*)"$/ do |category|
BlogPost.last.categories.first.title.should == category
end \ No newline at end of file
diff --git a/features/support/step_definitions/tags_steps.rb b/features/support/step_definitions/tags_steps.rb
index 7b895e5..8280474 100644
--- a/features/support/step_definitions/tags_steps.rb
+++ b/features/support/step_definitions/tags_steps.rb
@@ -1,9 +1,9 @@
Given /^there is a blog post titled "([^"]*)" and tagged "([^"]*)"$/ do |title, tag_name|
- @blog_post = Factory(:post, :title => title, :tag_list => tag_name)
+ @blog_post = Factory.create(:blog_post, :title => title, :tag_list => tag_name)
end
When /^I visit the tagged posts page for "([^"]*)"$/ do |tag_name|
- @blog_post ||= Factory(:post, :tag_list => tag_name)
+ @blog_post ||= Factory.create(:blog_post, :tag_list => tag_name)
tag = BlogPost.tag_counts_on(:tags).first
visit tagged_posts_path(tag.id, tag_name.parameterize)
end