Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define test factory classes using stringified class names #1176

Merged
merged 1 commit into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ User-visible changes worth mentioning.
- [#1162] Fix `enforce_content_type` for requests without body.
- [#1164] Fix error when `root_path` is not defined.
- [#1175] Internal refactor: use `scopes_string` inside `scopes`.
- [#1176] Fix test factory support for `factory_bot_rails`

## 5.0.2

Expand Down
6 changes: 3 additions & 3 deletions spec/factories.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FactoryBot.define do
factory :access_grant, class: Doorkeeper::AccessGrant do
factory :access_grant, class: "Doorkeeper::AccessGrant" do
sequence(:resource_owner_id) { |n| n }
application
redirect_uri { 'https://app.com/callback' }
expires_in { 100 }
scopes { 'public write' }
end

factory :access_token, class: Doorkeeper::AccessToken do
factory :access_token, class: "Doorkeeper::AccessToken" do
sequence(:resource_owner_id) { |n| n }
application
expires_in { 2.hours }
Expand All @@ -17,7 +17,7 @@
end
end

factory :application, class: Doorkeeper::Application do
factory :application, class: "Doorkeeper::Application" do
sequence(:name) { |n| "Application #{n}" }
redirect_uri { 'https://app.com/callback' }
end
Expand Down