move tests to new directory

This commit is contained in:
Reinier Balt 2013-05-11 23:13:16 +02:00
parent 65859807ea
commit 0bc9b0397a
42 changed files with 23 additions and 32 deletions

View file

@ -18,7 +18,7 @@ class MessageGatewayTest < ActiveSupport::TestCase
# assert some stuff about it being created # assert some stuff about it being created
assert_equal(todo_count+1, Todo.count) assert_equal(todo_count+1, Todo.count)
message_todo = Todo.find(:first, :conditions => {:description => "message_content"}) message_todo = Todo.where(:description => "message_content").first
assert_not_nil(message_todo) assert_not_nil(message_todo)
assert_equal(@inbox, message_todo.context) assert_equal(@inbox, message_todo.context)
@ -33,7 +33,7 @@ class MessageGatewayTest < ActiveSupport::TestCase
# assert some stuff about it being created # assert some stuff about it being created
assert_equal(todo_count+1, Todo.count) assert_equal(todo_count+1, Todo.count)
message_todo = Todo.find(:first, :conditions => {:description => "This is the subject"}) message_todo = Todo.where(:description => "This is the subject").first
assert_not_nil(message_todo) assert_not_nil(message_todo)
assert_equal(@inbox, message_todo.context) assert_equal(@inbox, message_todo.context)
@ -74,12 +74,12 @@ class MessageGatewayTest < ActiveSupport::TestCase
invalid_context_msg = message.gsub('message_content', 'this is also a task @ notacontext') invalid_context_msg = message.gsub('message_content', 'this is also a task @ notacontext')
MessageGateway.receive(valid_context_msg) MessageGateway.receive(valid_context_msg)
valid_context_todo = Todo.find(:first, :conditions => {:description => "this is a task"}) valid_context_todo = Todo.where(:description => "this is a task").first
assert_not_nil(valid_context_todo) assert_not_nil(valid_context_todo)
assert_equal(contexts(:anothercontext), valid_context_todo.context) assert_equal(contexts(:anothercontext), valid_context_todo.context)
MessageGateway.receive(invalid_context_msg) MessageGateway.receive(invalid_context_msg)
invalid_context_todo = Todo.find(:first, :conditions => {:description => 'this is also a task'}) invalid_context_todo = Todo.where(:description => 'this is also a task').first
assert_not_nil(invalid_context_todo) assert_not_nil(invalid_context_todo)
assert_equal(@inbox, invalid_context_todo.context) assert_equal(@inbox, invalid_context_todo.context)
end end

View file

@ -688,7 +688,7 @@ class TodosControllerTest < ActionController::TestCase
# locate the new todo. This todo is created from the adjusted recurring # locate the new todo. This todo is created from the adjusted recurring
# pattern defined in this test # pattern defined in this test
new_todo = Todo.find(:first, :conditions => {:recurring_todo_id => recurring_todo_1.id, :state => 'active'}) new_todo = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'active').first
assert !new_todo.nil? assert !new_todo.nil?
# mark new_todo as complete by toggle_check # mark new_todo as complete by toggle_check
@ -697,7 +697,7 @@ class TodosControllerTest < ActionController::TestCase
assert todo_1.completed? assert todo_1.completed?
# locate the new todo in tickler # locate the new todo in tickler
new_todo = Todo.find(:first, :conditions => {:recurring_todo_id => recurring_todo_1.id, :state => 'deferred'}) new_todo = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'deferred').first
assert !new_todo.nil? assert !new_todo.nil?
assert_equal "Call Bill Gates every day", new_todo.description assert_equal "Call Bill Gates every day", new_todo.description
@ -735,11 +735,11 @@ class TodosControllerTest < ActionController::TestCase
assert @todo.completed? assert @todo.completed?
# check that there is no active todo # check that there is no active todo
next_todo = Todo.find(:first, :conditions => {:recurring_todo_id => recurring_todo_1.id, :state => 'active'}) next_todo = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'active').first
assert next_todo.nil? assert next_todo.nil?
# check for new deferred todo # check for new deferred todo
next_todo = Todo.find(:first, :conditions => {:recurring_todo_id => recurring_todo_1.id, :state => 'deferred'}) next_todo = Todo.where(:recurring_todo_id => recurring_todo_1.id, :state => 'deferred').first
assert !next_todo.nil? assert !next_todo.nil?
# check that the due date of the new todo is later than tomorrow # check that the due date of the new todo is later than tomorrow
assert next_todo.due > @todo.due assert next_todo.due > @todo.due

View file

@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
class ContextXmlApiTest < ActionController::IntegrationTest class ContextXmlApiTest < ActionDispatch::IntegrationTest
@@context_name = "@newcontext" @@context_name = "@newcontext"
@@valid_postdata = "<context><name>#{@@context_name}</name></context>" @@valid_postdata = "<context><name>#{@@context_name}</name></context>"

View file

@ -1,6 +1,8 @@
require File.expand_path( File.dirname(__FILE__) + '/../test_helper') require File.expand_path( File.dirname(__FILE__) + '/../test_helper')
class FeedSmokeTest < ActionController::IntegrationTest class FeedSmokeTest < ActionDispatch::IntegrationTest
fixtures :users, :projects
def test_last_15_actions_rss def test_last_15_actions_rss
assert_success "/todos.rss?token=#{ users(:admin_user).token }&limit=15" assert_success "/todos.rss?token=#{ users(:admin_user).token }&limit=15"

View file

@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
class ProjectXmlApiTest < ActionController::IntegrationTest class ProjectXmlApiTest < ActionDispatch::IntegrationTest
@@project_name = "My New Project" @@project_name = "My New Project"
@@valid_postdata = "<project><name>#{@@project_name}</name></project>" @@valid_postdata = "<project><name>#{@@project_name}</name></project>"

View file

@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
class RecurringTodosTest < ActionController::IntegrationTest class RecurringTodosTest < ActionDispatch::IntegrationTest
def logs_in_as(user,plain_pass) def logs_in_as(user,plain_pass)
@user = user @user = user

View file

@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
class StoriesTest < ActionController::IntegrationTest class StoriesTest < ActionDispatch::IntegrationTest
# #################################################### # ####################################################
# Testing login and signup by different kinds of users # Testing login and signup by different kinds of users

View file

@ -4,8 +4,8 @@ class IsTaggableTest < ActiveSupport::TestCase
fixtures :todos, :recurring_todos fixtures :todos, :recurring_todos
def test_models_are_taggable def test_models_are_taggable
assert Todo.find(:first).respond_to?(:tag_list) assert Todo.first.respond_to?(:tag_list)
assert RecurringTodo.find(:first).respond_to?(:tag_list) assert RecurringTodo.first.respond_to?(:tag_list)
end end
def test_test_to_s def test_test_to_s

View file

@ -409,8 +409,8 @@ class TodoTest < ActiveSupport::TestCase
completed_now = @not_completed1 completed_now = @not_completed1
# When I use the finders # When I use the finders
recent_completed_todos = Todo.completed_after(1.month.ago).find(:all) recent_completed_todos = Todo.completed_after(1.month.ago)
older_completed_todos = Todo.completed_before(1.month.ago).find(:all) older_completed_todos = Todo.completed_before(1.month.ago)
# Then completed1 should be before and completed2 should be after a month ago # Then completed1 should be before and completed2 should be after a month ago
assert older_completed_todos.include?(completed_old) assert older_completed_todos.include?(completed_old)
@ -430,8 +430,8 @@ class TodoTest < ActiveSupport::TestCase
todo_now = user.todos.create!({:description => "just created", :context => @completed.context}) todo_now = user.todos.create!({:description => "just created", :context => @completed.context})
# When I use the finders # When I use the finders
recent_created_todos = Todo.created_after(1.month.ago).find(:all) recent_created_todos = Todo.created_after(1.month.ago)
older_created_todos = Todo.created_before(1.month.ago).find(:all) older_created_todos = Todo.created_before(1.month.ago)
# Then todo1 should be before and todo2 should be after a month ago # Then todo1 should be before and todo2 should be after a month ago
assert older_created_todos.include?(todo_old) assert older_created_todos.include?(todo_old)

View file

@ -1,12 +0,0 @@
require 'test_helper'
require 'rails/performance_test_help'
class BrowsingTest < ActionDispatch::PerformanceTest
# Refer to the documentation for all available options
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
# :output => 'tmp/performance', :formats => [:flat] }
def test_homepage
get '/'
end
end

View file

@ -6,6 +6,7 @@ require 'rails/test_help'
{"salt" => "change-me", "authentication_schemes" => ["database"], "prefered_auth" => "database"}.inject( SITE_CONFIG ) { |h, elem| h[elem[0]] = elem[1]; h } {"salt" => "change-me", "authentication_schemes" => ["database"], "prefered_auth" => "database"}.inject( SITE_CONFIG ) { |h, elem| h[elem[0]] = elem[1]; h }
class ActiveSupport::TestCase class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
# #
# Note: You'll currently still have to declare fixtures explicitly in integration tests # Note: You'll currently still have to declare fixtures explicitly in integration tests
@ -86,7 +87,7 @@ class ActionController::TestCase
end end
class ActionController::IntegrationTest class ActionDispatch::IntegrationTest
def authenticated_post_xml(url, username, password, parameters, headers = {}) def authenticated_post_xml(url, username, password, parameters, headers = {})
post url, parameters, post url, parameters,