Skip to content
Browse files

Changed test dependency to bcms_support gem

  • Loading branch information...
1 parent e42075b commit b369e20c201ecaee572d54a6f88d71b133db70be @alce alce committed Jul 10, 2010
Showing with 26 additions and 18 deletions.
  1. +1 −1 config/environments/test.rb
  2. +22 −15 test/functional/blog_post_controller_test.rb
  3. +3 −2 test/test_helper.rb
View
2 config/environments/test.rb
@@ -31,4 +31,4 @@
config.gem "factory_girl", :source => "http://gemcutter.org"
require "test/unit"
config.gem "mocha", :version => ">= 0.9.7"
-config.gem "bcms_test_support"
+config.gem "bcms_support"
View
37 test/functional/blog_post_controller_test.rb
@@ -5,32 +5,39 @@ class BlogPostControllerTest < ActionController::TestCase
def setup
seed_bcms_data
+ @content_type_group = ContentTypeGroup.create!(:name => "Blog")
+ CategoryType.create!(:name => "Blog Post")
+ ContentType.create!(:name => "Blog", :content_type_group => @content_type_group)
+ ContentType.create!(:name => "BlogPost", :content_type_group => @content_type_group)
+ ContentType.create!(:name => "BlogComment", :content_type_group => @content_type_group)
create_baseline_data
end
# def test_show_post
# get :show, :path => ["myblog"],
# :year => 2008,
# :month => 07,
- # :day => 05
- # # log @response.body
+ # :day => 05,
+ # :slug => @first_post.name.to_slug
+ # puts @response.body
+ #
# assert_response :success
# assert_select "title", @first_post.name
- # assert_select ".blog_post", 1
+ # # assert_select ".blog_post", 1
#
- # assert_select "#blog_post_#{@first_post.id}" do
- # assert_select "h2 a", @first_post.name
- # assert_select "p.body", @first_post.body
- # assert_select "p.meta a", "General"
- # assert_select "p.meta a", "0 Comments"
- # end
+ # # assert_select "#blog_post_#{@first_post.id}" do
+ # # assert_select "h2 a", @first_post.name
+ # # assert_select "p.body", @first_post.body
+ # # assert_select "p.meta a", "General"
+ # # assert_select "p.meta a", "0 Comments"
+ # # end
# end
- # def test_non_existent_slug_should_return_404
- # get :show, :path => ["blog", "post"],
- # :year => 2005, :month => 6, :day => 14,
- # :slug => "not-here"
- # assert_response :not_found
- # end
+ def test_non_existent_slug_should_return_404
+ get :show, :path => ["myblog"],
+ :year => 2005, :month => 6, :day => 14,
+ :slug => "not-here"
+ assert_response :not_found
+ end
end
View
5 test/test_helper.rb
@@ -4,10 +4,11 @@
require 'factory_girl'
require 'mocha'
require 'test_logging'
+require 'bcms_support'
class ActiveSupport::TestCase
- include Bcms::TestSupport
+ include BcmsSupport::Test
include TestLogging
self.use_transactional_fixtures = true
@@ -37,7 +38,7 @@ def create_baseline_data
@bar_post_2 = Factory(:blog_post, :blog => @blog, :category => @general,
:published_at => Time.utc(2009, 3, 18), :publish_on_save => true)
- Page.all.each(&:publish)
+ publish_all_pages
end
def setup_blog_stubs

0 comments on commit b369e20

Please sign in to comment.
Something went wrong with that request. Please try again.