Permalink
Browse files

fix all fixture related errors.

  • Loading branch information...
1 parent 62ad6a7 commit a8dee77862e6024042e45b57022db4dbb9c912ab @ruseel committed Nov 28, 2012
@@ -3,7 +3,7 @@
module Rboard
class BoardsControllerTest < ActionController::TestCase
setup do
- @board = boards(:one)
+ @board = rboard_boards(:one)
end
test "should get index" do
@@ -3,9 +3,9 @@
module Rboard
class CommentsControllerTest < ActionController::TestCase
setup do
- @board = boards(:one)
- @comment = comments(:one)
- @topic = topics(:one)
+ @board = rboard_boards(:one)
+ @comment = rboard_comments(:one)
+ @topic = rboard_topics(:one)
end
test "should show" do
@@ -3,8 +3,8 @@
module Rboard
class TopicsControllerTest < ActionController::TestCase
setup do
- @topic = topics(:one)
- @board = boards(:one)
+ @topic = rboard_topics(:one)
+ @board = rboard_boards(:one)
# boardish value is not setted for fixture, so do it.
@topic.boardish = Boardish.new
@@ -58,7 +58,7 @@ class TopicsControllerTest < ActionController::TestCase
end
test "should create reply" do
- reply = topics(:reply)
+ reply = rboard_topics(:reply)
post :create, topic: { subject: reply.subject, body: reply.body }, parent_id: @topic, board_id: @board
assert_equal @board, assigns(:topic).board
assert_equal @topic.boardish.inc_at_depth(1), assigns(:topic).boardish
@@ -3,11 +3,11 @@
module Rboard
class BoardFlowTest < ActionDispatch::IntegrationTest
setup do
- @topic = topics(:one)
+ @topic = rboard_topics(:one)
end
test "get url topics of boards(:one) " do
- get board_topics_path(boards(:one))
+ get board_topics_path(rboard_boards(:one))
assert_equal 1, assigns(:topics).size
end
end
@@ -3,7 +3,7 @@
module Rboard
class TopicFlowTest < ActionDispatch::IntegrationTest
setup do
- @board = boards(:one)
+ @board = rboard_boards(:one)
end
test "topic create, show, edit, update" do
View
@@ -1,6 +1,18 @@
+# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
-require File.expand_path('../../config/environment', __FILE__)
-require 'rails/test_help'
+
+require File.expand_path("../dummy/config/environment.rb", __FILE__)
+require "rails/test_help"
+
+Rails.backtrace_cleaner.remove_silencers!
+
+# Load support files
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+
+# Load fixtures from the engine
+if ActiveSupport::TestCase.method_defined?(:fixture_path=)
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
+end
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
@@ -11,3 +23,11 @@ class ActiveSupport::TestCase
# Add more helper methods to be used by all tests here...
end
+
+module Rboard
+ class ActionController::TestCase
+ setup do
+ @routes = Engine.routes
+ end
+ end
+end
@@ -3,7 +3,7 @@
module Rboard
class CommentTest < ActiveSupport::TestCase
setup do
- @topic = topics(:one)
+ @topic = rboard_topics(:one)
end
test "belongs_to topic" do
@@ -6,13 +6,13 @@ class TopicTest < ActiveSupport::TestCase
setup do
@topic = rboard_topics(:one)
- @board = boards(:one)
+ @board = rboard_boards(:one)
end
test "topic belongs to board" do
Topic.create(subject: @topic.subject, body: @topic.body, board: @board)
- assert_equal 1, boards(:two).topics.count
+ assert_equal 1, rboard_boards(:two).topics.count
end
test "create new topic without parent" do

0 comments on commit a8dee77

Please sign in to comment.