Skip to content

Commit

Permalink
Remove ORM specifics from spec
Browse files Browse the repository at this point in the history
  • Loading branch information
tute committed May 5, 2015
1 parent 0b0031e commit 8ddf675
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 108 deletions.
24 changes: 1 addition & 23 deletions spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
case DOORKEEPER_ORM.to_s
when "active_record"
class User < ActiveRecord::Base
end
when /mongoid/
class User
include Mongoid::Document
include Mongoid::Timestamps

field :name, type: String
field :password, type: String
end
when "mongo_mapper"
class User
include MongoMapper::Document
timestamps!

key :name, String
key :password, String
end
end

class User
class User < ActiveRecord::Base
if ::Rails.version.to_i < 4 || defined?(::ProtectedAttributes)
attr_accessible :name, :password
end
Expand Down
1 change: 0 additions & 1 deletion spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
else
DOORKEEPER_ORM
end

require "#{orm}/railtie"

module Dummy
Expand Down
2 changes: 0 additions & 2 deletions spec/dummy/config/initializers/doorkeeper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
Doorkeeper.configure do
# Change the ORM that doorkeeper will use.
# Currently supported options are :active_record, :mongoid2, :mongoid3,
# :mongoid4, :mongo_mapper
orm DOORKEEPER_ORM

# This block will be called to check whether the resource owner is authenticated or not.
Expand Down
11 changes: 0 additions & 11 deletions spec/dummy/config/mongo.yml

This file was deleted.

9 changes: 0 additions & 9 deletions spec/dummy/config/mongoid2.yml

This file was deleted.

18 changes: 0 additions & 18 deletions spec/dummy/config/mongoid3.yml

This file was deleted.

19 changes: 0 additions & 19 deletions spec/dummy/config/mongoid4.yml

This file was deleted.

6 changes: 1 addition & 5 deletions spec/spec_helper_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
Rails.logger.info "====> Rails version: #{Rails.version}"
Rails.logger.info "====> Ruby version: #{RUBY_VERSION}"

if [:mongoid2, :mongoid3, :mongoid4].include?(DOORKEEPER_ORM)
require "support/orm/mongoid"
else
require "support/orm/#{DOORKEEPER_ORM}"
end
require "support/orm/#{DOORKEEPER_ORM}"

ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../')

Expand Down
10 changes: 0 additions & 10 deletions spec/support/orm/mongo_mapper.rb

This file was deleted.

10 changes: 0 additions & 10 deletions spec/support/orm/mongoid.rb

This file was deleted.

0 comments on commit 8ddf675

Please sign in to comment.