Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Always clean up database before running each test.

  • Loading branch information...
commit 7f7cfc4ea841043d79f9430f397b47381e467054 1 parent c54e4e0
@steverandy authored
View
3  Gemfile
@@ -20,5 +20,4 @@ gem "domainatrix", "~> 0.0.10"
gem "capybara", ">= 0.4.0"
gem "fabrication", "1.1.0"
gem "database_cleaner", "0.6.0"
-gem "ansi"
-gem "turn"
+gem "minitest", "~> 2.6.1"
View
7 Gemfile.lock
@@ -31,7 +31,6 @@ GEM
activesupport (3.1.0)
multi_json (~> 1.0)
addressable (2.2.6)
- ansi (1.2.5)
arel (2.2.1)
bcrypt-ruby (3.0.0)
bson (1.3.1)
@@ -68,6 +67,7 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
+ minitest (2.6.1)
mongo (1.3.1)
bson (>= 1.3.1)
mongo-rails-instrumentation (0.2.4)
@@ -130,8 +130,6 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- turn (0.8.2)
- ansi (>= 1.2.2)
tzinfo (0.3.29)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -140,7 +138,6 @@ PLATFORMS
ruby
DEPENDENCIES
- ansi
bcrypt-ruby (~> 3.0.0)
bson_ext (~> 1.3.1)
capybara (>= 0.4.0)
@@ -151,6 +148,7 @@ DEPENDENCIES
fabrication (= 1.1.0)
haml (~> 3.1.0)
mime-types (~> 1.16)
+ minitest (~> 2.6.1)
mongo-rails-instrumentation (~> 0.2.4)
mongoid (~> 2.2.1)
mustache (~> 0.99.4)
@@ -158,4 +156,3 @@ DEPENDENCIES
rails (>= 3.1.0)
redcarpet (= 2.0.0b5)
sass-rails (~> 3.1.0)
- turn
View
4 Rakefile
@@ -7,13 +7,13 @@ rescue LoadError
end
require "rake"
-require "rake/rdoctask"
+require "rdoc/task"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "lib"
t.libs << "test"
- t.pattern = "test/**/*_test.rb"
+ t.test_files = Dir.glob("test/**/*_test.rb")
t.verbose = false
end
View
2  test/test_helper.rb
@@ -5,7 +5,6 @@
require File.expand_path("../fabricators.rb", __FILE__)
require "rails/test_help"
require "database_cleaner"
-require "turn"
ActionMailer::Base.delivery_method = :test
ActionMailer::Base.perform_deliveries = true
@@ -23,5 +22,4 @@
# Clean database.
DatabaseCleaner.strategy = :truncation
-DatabaseCleaner.start
DatabaseCleaner.clean
View
4 test/unit/concen_test.rb
@@ -3,6 +3,10 @@
require "minitest/autorun"
describe Concen do
+ before do
+ DatabaseCleaner.clean
+ end
+
it "must be a Module" do
Concen.must_be_kind_of Module
end
View
4 test/unit/grid_file_test.rb
@@ -3,6 +3,10 @@
require "minitest/autorun"
describe Concen::GridFile do
+ before do
+ DatabaseCleaner.clean
+ end
+
it "can store file in GridFS" do
page = Fabricate "concen/page"
grid_file = page.grid_files.build
View
2  test/unit/page_test.rb
@@ -3,7 +3,7 @@
require "minitest/autorun"
describe Concen::Page do
- def setup
+ before do
DatabaseCleaner.clean
end
View
4 test/unit/user_test.rb
@@ -3,6 +3,10 @@
require "minitest/autorun"
describe Concen::User do
+ before do
+ DatabaseCleaner.clean
+ end
+
it "can create user" do
user = Fabricate "concen/user"
user.id.wont_be_nil
Please sign in to comment.
Something went wrong with that request. Please try again.