Skip to content
Open
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
6 changes: 6 additions & 0 deletions lib/onesignal/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ class Configuration
# OneSignal API token for User Authentication
attr_accessor :user_key

# OneSignal Organization API Key
attr_accessor :organization_api_key

# OneSignal REST API Key
attr_accessor :rest_api_key

# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
# details will be logged with `logger.debug` (see the `logger` attribute).
# Default to false.
Expand Down
12 changes: 12 additions & 0 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,16 @@
end
end
end

describe 'API keys' do
it 'should allow setting and retrieving organization_api_key' do
config.organization_api_key = 'test_org_key'
expect(config.organization_api_key).to eq('test_org_key')
end

it 'should allow setting and retrieving rest_api_key' do
config.rest_api_key = 'test_rest_key'
expect(config.rest_api_key).to eq('test_rest_key')
end
end
end