Skip to content

Commit

Permalink
fix more spec warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
glebtv committed Nov 17, 2013
1 parent 842d948 commit a907025
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 0 additions & 4 deletions spec/integration/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

describe Mongoid::Audit do
before :all do
class HistoryTracker
include Mongoid::Audit::Tracker
end

class Post
include Mongoid::Document
include Mongoid::Timestamps
Expand Down
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ def self.add_extension(*args); end
end

require 'mongoid-audit'
class HistoryTracker
include Mongoid::Audit::Tracker
end
10 changes: 10 additions & 0 deletions spec/trackable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def compare( option )

describe "#track_history" do
before :each do
Object.send(:remove_const, :MyModel) if Object.constants.include?(:MyModel)

class MyModel
include Mongoid::Document
include Mongoid::Audit::Trackable
Expand Down Expand Up @@ -73,6 +75,14 @@ class MyModel

context "sub-model" do
before :each do
Object.send(:remove_const, :MyModel) if Object.constants.include?(:MyModel)
Object.send(:remove_const, :MySubModel) if Object.constants.include?(:MySubModel)

class MyModel
include Mongoid::Document
include Mongoid::Audit::Trackable
track_history
end
class MySubModel < MyModel
end
end
Expand Down

0 comments on commit a907025

Please sign in to comment.