Skip to content

Commit

Permalink
fix: updated #build_user spec helper to by MongoMapper aware
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethkalmer committed Jan 28, 2015
1 parent 76a95a8 commit 30256ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/audited_spec_helpers.rb
Expand Up @@ -5,8 +5,9 @@ def create_user(use_mongo = false, attrs = {})
klass.create({:name => 'Brandon', :username => 'brandon', :password => 'password'}.merge(attrs))
end

def build_user(attrs = {})
User.new({:name => 'darth', :username => 'darth', :password => 'noooooooo'}.merge(attrs))
def build_user(use_mongo = false, attrs = {})
klass = use_mongo ? Models::MongoMapper::User : Models::ActiveRecord::User
klass.new({:name => 'darth', :username => 'darth', :password => 'noooooooo'}.merge(attrs))
end

def create_versions(n = 2, use_mongo = false)
Expand Down

0 comments on commit 30256ee

Please sign in to comment.