Skip to content

Commit

Permalink
Merge pull request #1176 from sman591/string-factories
Browse files Browse the repository at this point in the history
Define test factory classes using stringified class names
  • Loading branch information
nbulaj committed Jan 4, 2019
2 parents 18833b6 + dc59f39 commit 89d217a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit 89d217a

Please sign in to comment.