-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from omniauth/orm_specs
Add missing ORM specs and fix bugs discovered
- Loading branch information
Showing
33 changed files
with
660 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
/rethinkdb_data | ||
|
||
*.gem | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
SimpleCov.start do | ||
add_filter '/.github/' | ||
add_filter '/coverage/' | ||
add_filter '/rethinkdb_data/' | ||
add_filter '/spec/' | ||
add_filter '/spec_orms/' | ||
add_filter '/vendor/bundle/' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,8 +93,8 @@ Just include `OmniAuth::Identity::Models::Sequel` mixin, and specify | |
whatever else you will need. | ||
|
||
```ruby | ||
class SequelTestIdentity < Sequel::Model | ||
include OmniAuth::Identity::Models::Sequel | ||
class SequelTestIdentity < Sequel::Model(:identities) | ||
include ::OmniAuth::Identity::Models::Sequel | ||
auth_key :email | ||
# whatever else you want! | ||
end | ||
|
@@ -108,8 +108,8 @@ fields that you will need. | |
|
||
```ruby | ||
class Identity | ||
include Mongoid::Document | ||
include OmniAuth::Identity::Models::Mongoid | ||
include ::Mongoid::Document | ||
include ::OmniAuth::Identity::Models::Mongoid | ||
|
||
field :email, type: String | ||
field :name, type: String | ||
|
@@ -124,8 +124,9 @@ fields that you will need. | |
|
||
```ruby | ||
class Identity | ||
include CouchPotato::Persistence | ||
include OmniAuth::Identity::Models::CouchPotatoModule | ||
# NOTE: CouchPotato::Persistence must be included before OmniAuth::Identity::Models::CouchPotatoModule | ||
include ::CouchPotato::Persistence | ||
include ::OmniAuth::Identity::Models::CouchPotatoModule | ||
|
||
property :email | ||
property :password_digest | ||
|
@@ -147,8 +148,8 @@ fields that you will need. | |
|
||
```ruby | ||
class Identity | ||
include NoBrainer::Document | ||
include OmniAuth::Identity::Models::NoBrainer | ||
include ::NoBrainer::Document | ||
include ::OmniAuth::Identity::Models::NoBrainer | ||
|
||
auth_key :email | ||
end | ||
|
@@ -265,6 +266,49 @@ option :locate_conditions, ->(req) { { model.auth_key => req['auth_key'] } } | |
|
||
Please contribute some documentation if you have the gumption! The maintainer's time is limited, and sometimes the authors of PRs with new options don't update the _this_ readme. 😭 | ||
|
||
## Contributing | ||
|
||
1. Fork it | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am ‘Added some feature’`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally. | ||
- NOTE: In order to run *all* the tests you will need to have the following databases installed, configured, and running. | ||
1. [RethinkDB](https://rethinkdb.com), an open source, real-time, web database, [installed](https://rethinkdb.com/docs/install/) and [running](https://rethinkdb.com/docs/start-a-server/), e.g. | ||
```bash | ||
brew install rethinkdb | ||
rethinkdb | ||
``` | ||
2. [MongoDB](https://docs.mongodb.com/manual/administration/install-community/) | ||
```bash | ||
brew tap mongodb/brew | ||
brew install [email protected] | ||
mongod --config /usr/local/etc/mongod.conf | ||
``` | ||
3. [CouchDB](https://couchdb.apache.org) (download the .app) | ||
To run all tests on all databases: | ||
```bash | ||
bundle exec rake | ||
``` | ||
To run a specific DB: | ||
```bash | ||
# CouchDB / CouchPotato | ||
bundle exec rspec spec spec_orms --tag 'couchdb' | ||
# ActiveRecord and Sequel, as they both use the in-memory SQLite driver. | ||
bundle exec rspec spec spec_orms --tag 'sqlite3' | ||
# NOTE - mongoid and nobrainer specs can't be isolated with "tag" because it still loads everything, | ||
# and the two libraries are fundamentally incompatible. | ||
# MongoDB / Mongoid | ||
bundle exec rspec spec_orms/mongoid_spec.rb | ||
# RethinkDB / NoBrainer | ||
bundle exec rspec spec_orms/nobrainer_spec.rb | ||
``` | ||
6. Create new Pull Request | ||
|
||
## License | ||
|
||
MIT License. See LICENSE for details. | ||
|
Oops, something went wrong.