Permalink
Browse files

removed save from compatability, seems the validates false was define…

…d in correctly
  • Loading branch information...
1 parent d52505f commit c0dd110c1e8ebf6ee0637efa8cdfb29aff8e45ae bhbryant committed Jan 9, 2011
Showing with 42 additions and 17 deletions.
  1. +7 −1 Gemfile
  2. +29 −12 Rakefile
  3. +2 −2 lib/devise/orm/mongo_mapper/compatibility.rb
  4. +2 −0 test/rails_app/config/application.rb
  5. +2 −2 test/test_helper.rb
View
@@ -1,7 +1,8 @@
source :rubygems
source 'http://gems.github.com/'
-gem "rails", :git => "git://github.com/rails/rails.git"
+gem "rails"
+
group :test do
gem "test-unit", "~> 2.0.9"
@@ -21,5 +22,10 @@ group :default do
gem 'rails3-generators', '>= 0.13.0'
gem 'jnunemaker-validatable', '~> 1.8.1'
gem 'bson_ext', '>= 1.0.9'
+
+ gem "orm_adapter"
+ gem "omniauth"
+
+
end
View
@@ -1,37 +1,53 @@
# encoding: UTF-8
require 'rake'
+require 'bundler'
+Bundler::GemHelper.install_tasks
+
+
require 'rake/testtask'
require 'rake/rdoctask'
require File.join(File.dirname(__FILE__), 'lib', 'mm-devise', 'version')
-desc 'Default: run tests for all MongoMapper ORM setups.'
-task :default => :pre_commit
-desc 'Run Devise tests for all MongoMapper ORM setups.'
-task :pre_commit do
- Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
- orm = File.basename(file).split(".").first
- ENV['DEVISE_PATH'] ||= File.expand_path('../devise')
- system "rake test DEVISE_ORM=#{orm} DEVISE_PATH=#{ENV['DEVISE_PATH']}"
- end
-end
+
+
desc 'Run Devise tests using MongoMapper. Specify path to devise with DEVISE_PATH'
+
+
Rake::TestTask.new(:test) do |test|
ENV['DEVISE_ORM'] ||= 'mongo_mapper'
- ENV['DEVISE_PATH'] ||= File.expand_path('../devise')
+ ENV['DEVISE_PATH'] ||= File.join(File.dirname(__FILE__), '../devise')
unless File.exist?(ENV['DEVISE_PATH'])
puts "Specify the path to devise (e.g. rake DEVISE_PATH=/path/to/devise). Not found at #{ENV['DEVISE_PATH']}"
exit
end
+
test.libs << 'lib' << 'test'
test.libs << "#{ENV['DEVISE_PATH']}/lib"
test.libs << "#{ENV['DEVISE_PATH']}/test"
- test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] + FileList['test/**/*_test.rb']
+ test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] + FileList['test/**/*_test.rb']
test.verbose = true
end
+desc 'Default: run tests for all ORMs.'
+task :default => :tests
+
+=begin
+desc 'Default: run tests for all MongoMapper ORM setups.'
+task :default => :pre_commit
+
+desc 'Run Devise tests for all MongoMapper ORM setups.'
+task :pre_commit do
+ Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
+ orm = File.basename(file).split(".").first
+ ENV['DEVISE_PATH'] ||= File.expand_path('../devise')
+ system "rake test DEVISE_ORM=#{orm} DEVISE_PATH=#{ENV['DEVISE_PATH']}"
+ end
+end
+
+
task :test
desc 'Generate documentation for dm-devise.'
@@ -67,3 +83,4 @@ begin
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end
+=end
@@ -63,7 +63,7 @@ def find(*args)
# def changed?
# dirty?
# end
-
+=begin
def save(options=nil)
if options.is_a?(Hash) && options[:validate] == false
save!
@@ -79,7 +79,7 @@ def update_attribute(name, value)
# def update_attributes(*args)
# update(*args)
# end
-
+=end
def invalid?
!valid?
end
@@ -35,3 +35,5 @@ class Application < Rails::Application
config.action_mailer.default_url_options = { :host => "localhost:3000" }
end
end
+
+
View
@@ -8,7 +8,7 @@
require "rails/test_help"
require "orm/#{DEVISE_ORM}"
-MongoMapper.connection = Mongo::Connection.new('localhost')
+MongoMapper.connection = Mongo::Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost')
MongoMapper.database = 'mm-devise-db'
I18n.load_path << "#{DEVISE_PATH}/test/support/locale/en.yml"
@@ -19,7 +19,7 @@
config.open_error_files = false
end
-Devise::Oauth.test_mode!
+#Devise::Oauth.test_mode!
# Add support to load paths so we can overwrite broken webrat setup
$:.unshift "#{DEVISE_PATH}/test/support"

0 comments on commit c0dd110

Please sign in to comment.