aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-11-22 15:23:25 +1300
committerPhilip Arndt <parndt@gmail.com>2010-11-22 15:26:53 +1300
commite5b9af1054bbd259bde0265acf4386cdaab0ca41 (patch)
treea5a89e83d262aab943c7e3f5d22dc52788de24d8 /spec
parentebb4c59cef0eb4e89700275e23579ca6dd18d619 (diff)
parent6d94a0ba7b781f93519183c96bbc718465dccdb4 (diff)
downloadrefinerycms-blog-e5b9af1054bbd259bde0265acf4386cdaab0ca41.tar.gz
refinerycms-blog-e5b9af1054bbd259bde0265acf4386cdaab0ca41.tar.bz2
refinerycms-blog-e5b9af1054bbd259bde0265acf4386cdaab0ca41.zip
Merged in Joe's and Steven's forks and updated for compatibility with < 0.9.9. Also, specs now work by including the factories and I have also laid the foundation for cucumber features. Fixed an issue where the javascript file was clashing with the same code we merged to core from this engine relating to submenus. Regenerated gemspec.
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/blog_categories.rb4
-rw-r--r--spec/factories/blog_comments.rb10
-rw-r--r--spec/factories/blog_posts.rb4
-rw-r--r--spec/models/blog_categories_spec.rb11
-rw-r--r--spec/models/blog_comments_spec.rb1
-rw-r--r--spec/models/blog_posts_spec.rb1
6 files changed, 8 insertions, 23 deletions
diff --git a/spec/factories/blog_categories.rb b/spec/factories/blog_categories.rb
deleted file mode 100644
index 590e5b5..0000000
--- a/spec/factories/blog_categories.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-Factory.define(:blog_category) do |f|
- f.title "Shopping"
- f.posts {|p| [p.association :post]}
-end \ No newline at end of file
diff --git a/spec/factories/blog_comments.rb b/spec/factories/blog_comments.rb
deleted file mode 100644
index 93beaf3..0000000
--- a/spec/factories/blog_comments.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-Factory.sequence :email do |n|
- "person#{n}@example.com"
-end
-
-Factory.define(:blog_comment) do |f|
- f.name "Joe Commenter"
- f.email { Factory.next(:email) }
- f.body "Which one is the best for picking up new shoes?"
- f.association :post
-end \ No newline at end of file
diff --git a/spec/factories/blog_posts.rb b/spec/factories/blog_posts.rb
deleted file mode 100644
index 6947e81..0000000
--- a/spec/factories/blog_posts.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-Factory.define(:post, :class => BlogPost) do |f|
- f.title "Top Ten 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."
-end \ No newline at end of file
diff --git a/spec/models/blog_categories_spec.rb b/spec/models/blog_categories_spec.rb
index d97172c..90d9e22 100644
--- a/spec/models/blog_categories_spec.rb
+++ b/spec/models/blog_categories_spec.rb
@@ -1,20 +1,21 @@
require 'spec_helper'
+Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory}
describe BlogCategory do
context "wiring up" do
-
+
before(:each) do
@category = Factory(:blog_category)
end
-
+
it "saves" do
@category.should_not be_nil
end
-
+
it "has a blog post" do
BlogPost.last.categories.should include(@category)
end
-
+
end
-
+
end \ No newline at end of file
diff --git a/spec/models/blog_comments_spec.rb b/spec/models/blog_comments_spec.rb
index 145626d..7966b46 100644
--- a/spec/models/blog_comments_spec.rb
+++ b/spec/models/blog_comments_spec.rb
@@ -1,4 +1,5 @@
require 'spec_helper'
+Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory}
describe BlogComment do
diff --git a/spec/models/blog_posts_spec.rb b/spec/models/blog_posts_spec.rb
index a334c73..3801de8 100644
--- a/spec/models/blog_posts_spec.rb
+++ b/spec/models/blog_posts_spec.rb
@@ -1,4 +1,5 @@
require 'spec_helper'
+Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each{|factory| require factory}
describe BlogPost do
context "wiring up" do