Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Add User Agent Integration Headers (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlitvakb authored Jun 15, 2017
1 parent 9bd4e9b commit a6a6fa2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Added
* Independent file per entry [#45](https://github.com/contentful/jekyll-contentful-data-import/pull/45) [#10](https://github.com/contentful/jekyll-contentful-data-import/issues/10) [#23](https://github.com/contentful/jekyll-contentful-data-import/pull/23) [#25](https://github.com/contentful/jekyll-contentful-data-import/issues/25)
* Added User Agent Integration Headers

## v1.5.1
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion jekyll-contentful.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.add_dependency("jekyll", ">= 2.5.0", "< 4")

# Additional dependencies
s.add_dependency("contentful", '>= 2.0.1', '~> 2.0')
s.add_dependency("contentful", '~> 2.1')

s.add_development_dependency 'rubygems-tasks', '~> 0.2'
s.add_development_dependency "guard"
Expand Down
4 changes: 3 additions & 1 deletion lib/jekyll-contentful-data-import/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def client(space, access_token, options = {})
space: space,
access_token: access_token,
dynamic_entries: :auto,
raise_errors: true
raise_errors: true,
integration_name: 'jekyll',
integration_version: Jekyll::Contentful::VERSION
}.merge(options)

::Contentful::Client.new(options)
Expand Down
18 changes: 16 additions & 2 deletions spec/jekyll-contentful/importer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,27 @@ def run; end

describe '#client' do
it 'creates client with some defaults' do
expect(::Contentful::Client).to receive(:new).with(space: 'foo', access_token: 'foobar', dynamic_entries: :auto, raise_errors: true)
expect(::Contentful::Client).to receive(:new).with(
space: 'foo',
access_token: 'foobar',
dynamic_entries: :auto,
raise_errors: true,
integration_name: 'jekyll',
integration_version: Jekyll::Contentful::VERSION
)

subject.client('foo', 'foobar')
end

it 'can override the defaults' do
expect(::Contentful::Client).to receive(:new).with(space: 'foo', access_token: 'foobar', dynamic_entries: :auto, raise_errors: false)
expect(::Contentful::Client).to receive(:new).with(
space: 'foo',
access_token: 'foobar',
dynamic_entries: :auto,
raise_errors: false,
integration_name: 'jekyll',
integration_version: Jekyll::Contentful::VERSION
)

subject.client('foo', 'foobar', raise_errors: false)
end
Expand Down

0 comments on commit a6a6fa2

Please sign in to comment.