Skip to content

Commit 23c44ce

Browse files
committed
Unit test
1 parent e0b39c2 commit 23c44ce

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

spec/lib/config_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,19 @@ class ApplicationWithOwner < ActiveRecord::Base
533533
end
534534
expect(config.custom_access_token_attributes).to eq([:tenant_name])
535535
end
536+
537+
it "removes unrecognized attributes" do
538+
# Once for access_grant_model, and again for access_token_model.
539+
expect(Rails.logger).to receive(:warn).with(/custom attribute will be ignored/)
540+
expect(Rails.logger).to receive(:warn).with(/custom attribute will be ignored/)
541+
542+
Doorkeeper.configure do
543+
orm DOORKEEPER_ORM
544+
custom_access_token_attributes [:tenant_name, :unrecognized_attribute]
545+
end
546+
547+
expect(config.custom_access_token_attributes).to eq([:tenant_name])
548+
end
536549
end
537550

538551
describe "application_secret_generator" do

0 commit comments

Comments
 (0)