content_network 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1a37b22ad605c692ca3b78641165a876834f6baa
4
+ data.tar.gz: 37fe14846c84f3af02f6e1836a653be2ec575b10
5
+ SHA512:
6
+ metadata.gz: aa16dba0e2369b582be87719cd0328852d645233bc8da9a3fc914d765475aceb7bc4b36f8f2ae7ec647d5a4525cb6e1a562ec094c730dedade5970713f29bdc0
7
+ data.tar.gz: 89ce3cc1719a4a520e36f022bff36488dda75d08f9eacdc87f214d1884d2548d40850e69e99667cabf6aafc9c7d68479af4f25f64752dee03ee42fb5d1d1ce0f
@@ -0,0 +1,4 @@
1
+ /pkg
2
+ /coverage
3
+ /Gemfile.lock
4
+ /tmp
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.3.0
4
+ script: bundle exec rake spec
5
+ notifications:
6
+ email:
7
+ - support@travellink.com.au
8
+ flowdock:
9
+ secure: RaQGWeReQ0CLDUbo6s2RSTgyB0LgzOUTjdLDOg7BotRf1uouGZ3+g1j3cebe53BZkfsi++raabdlcEJdFpUeP/F5OivxRDTHice4xYJULJ7pwum3d2L7eysxlAPAPIBW/gB9EH+Br/H9LujgbMesb6amK3LE5hq2NPtwEq2xT0xy9kxrYQYrvPR82+aCU7PbWwFLw7nVlDF1AvogGMO2Enm0dVvat6szf1eveO8I85n55hGjzYkDjVQBZMpMu9jNbti9q3+j9tR6IbzUFnmrIHczyO9JqWZpACRJwXBNbikC+w6vCqViBpx/yA+D7K5c+rHnRa6Wj37096Lf7XdLQ1h8MR0wK7PqhhnYlaapK+16GJ3Qj/RcFSypYMeX0mL2hNds27NkOUSJGwkFUmwnPseSi2R1mtd2ZbXBruG/LDTJy8DKUVIuySpv4RuZGmL2SBPYofYWVIUqKmb1IWLJZUbPG0HE4HoB/Xrl7HCaGZELO2Kuxb+J7IZisyEp9WdhXIdr0uNB5SDB6jqdgIFeXnMRMFfJDh0gdgrcdx76L5FhNgm/0rfnL7y0ojw7avQh76SgbyquqUY5oUnWYuI5PrpJsH4m1SOnG6s1M0XIH4CRvOKkq/3/ivss+E1gwepJl8MHHy12r4TFiVdqtgxlV+tIMDk0j10mvxFHvWFttx8=
10
+ sudo: false
11
+ cache: bundler
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
@@ -0,0 +1,25 @@
1
+ Content Network
2
+ ===============
3
+
4
+ [![Build Status](https://travis-ci.org/sealink/content_network.png?branch=master)](https://travis-ci.org/sealink/content_network)
5
+ [![Coverage Status](https://coveralls.io/repos/sealink/content_network/badge.png)](https://coveralls.io/r/sealink/content_network)
6
+ [![Dependency Status](https://gemnasium.com/sealink/content_network.png?travis)](https://gemnasium.com/sealink/content_network)
7
+ [![Code Climate](https://codeclimate.com/github/sealink/content_network.png)](https://codeclimate.com/github/sealink/content_network)
8
+
9
+ # DESCRIPTION
10
+
11
+ Integrates with SeaLink's content network project
12
+
13
+ # INSTALLATION
14
+
15
+ gem install content_network
16
+
17
+ or add to your Gemfile:
18
+ gem 'content_network'
19
+
20
+ # SYNOPSIS
21
+
22
+ require 'content_network'
23
+
24
+ For examples on most usage see the tests in the spec directory.
25
+ As these contain many basic examples with expected output.
@@ -0,0 +1,12 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ desc 'Default: run specs.'
4
+ task :default => :spec
5
+
6
+ require 'rspec/core/rake_task'
7
+
8
+ desc "Run specs"
9
+ RSpec::Core::RakeTask.new do |t|
10
+ t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
11
+ # Put spec opts in a file named .rspec in root
12
+ end
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'content_network/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "content_network"
8
+ spec.version = ContentNetwork::VERSION
9
+ spec.authors = ["Michael Noack"]
10
+ spec.email = ["support@travellink.com.au"]
11
+ spec.description = %q{Integrate with SeaLink's content network provider.}
12
+ spec.summary = %q{Integrate with SeaLink's content network provider.}
13
+ spec.homepage = 'http://github.com/sealink/content_network'
14
+
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency 'facets', '~> 3.0'
23
+
24
+ spec.add_development_dependency 'bundler'
25
+ spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'rspec'
27
+ spec.add_development_dependency 'rspec-its'
28
+ spec.add_development_dependency 'vcr'
29
+ spec.add_development_dependency 'webmock'
30
+ spec.add_development_dependency 'simplecov'
31
+ spec.add_development_dependency 'simplecov-rcov'
32
+ spec.add_development_dependency 'coveralls'
33
+ spec.add_development_dependency 'travis'
34
+ spec.add_development_dependency 'pry-byebug'
35
+ end
@@ -0,0 +1,14 @@
1
+ require 'content_network/path_params'
2
+ require 'content_network/pagination_params'
3
+ require 'content_network/collection'
4
+ require 'content_network/entries_fetcher'
5
+
6
+ module ContentNetwork
7
+ def self.base_uri(uri = nil)
8
+ if uri
9
+ @base_uri = URI(uri)
10
+ else
11
+ @base_uri
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,41 @@
1
+ module ContentNetwork
2
+ class Collection
3
+ def initialize(response)
4
+ @response = response
5
+ end
6
+
7
+ def data
8
+ return nil if error?
9
+ parsed_response['data']
10
+ end
11
+
12
+ def pagination?
13
+ return false if error?
14
+ parsed_response['meta'].has_key?('pagination')
15
+ end
16
+
17
+ def pagination
18
+ return nil unless pagination?
19
+ parsed_response['meta']['pagination']
20
+ end
21
+
22
+ def error?
23
+ parsed_response
24
+ @error.present?
25
+ end
26
+
27
+ def error
28
+ parsed_response
29
+ @error
30
+ end
31
+
32
+ private
33
+
34
+ def parsed_response
35
+ @parsed_response ||= JSON.parse(@response)
36
+ rescue JSON::ParserError => e
37
+ @error = e.message
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,30 @@
1
+ module ContentNetwork
2
+ class EntriesFetcher
3
+ def initialize(path_params = {}, pagination_params = {})
4
+ @path_params = PathParams.build(path_params)
5
+ @pagination_params = PaginationParams.build(pagination_params)
6
+ end
7
+
8
+ def fetch
9
+ response = execute_query
10
+ Collection.new(response.body)
11
+ end
12
+
13
+ private
14
+
15
+ def execute_query
16
+ uri = build_uri
17
+ uri.query = build_query
18
+ Net::HTTP.get_response(uri)
19
+ end
20
+
21
+ def build_query
22
+ URI.encode_www_form(@pagination_params.to_h)
23
+ end
24
+
25
+ def build_uri
26
+ path = @path_params.path
27
+ URI.join(ContentNetwork.base_uri, path)
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,21 @@
1
+ module ContentNetwork
2
+ class PaginationParams
3
+ def self.build(params)
4
+ new(params.slice(*ATTRS))
5
+ end
6
+
7
+ ATTRS = %i(page)
8
+
9
+ attr_reader *ATTRS
10
+
11
+ def initialize(page: 1)
12
+ @page = page
13
+ end
14
+
15
+ def to_h
16
+ {
17
+ page: @page
18
+ }
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ module ContentNetwork
2
+ class PathParams
3
+ def self.build(params)
4
+ new(params.slice(*ATTRS))
5
+ end
6
+
7
+ ATTRS = %i(element_type section_name entry_type entry_id)
8
+
9
+ attr_reader *ATTRS
10
+
11
+ def initialize(element_type: 'Entry', section_name: 'all', entry_type: 'all', entry_id: 'all')
12
+ @element_type = element_type
13
+ @section_name = section_name
14
+ @entry_type = entry_type
15
+ @entry_id = entry_id
16
+ end
17
+
18
+ def path
19
+ [@element_type, @section_name, @entry_type, @entry_id].join('/')
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,3 @@
1
+ module ContentNetwork
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,77 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://local.content-network.dev/zapi/v1/Entry/ondeck/ondeckSpecial/all?page=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - local.content-network.dev
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx/1.9.11
25
+ Date:
26
+ - Tue, 23 Feb 2016 06:28:47 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - CraftSessionId=3l0mn5dic3jvc8d3pda4fotso3; path=/; domain=local.content-network.dev;
35
+ HttpOnly
36
+ X-Powered-By:
37
+ - Craft CMS
38
+ Expires:
39
+ - Tue, 16 Feb 2016 06:28:47 GMT
40
+ Pragma:
41
+ - no-cache
42
+ Cache-Control:
43
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
44
+ body:
45
+ encoding: UTF-8
46
+ string: "Array\n(\n [elementType] => Entry\n [criteria] => Array\n (\n
47
+ \ [section] => ondeck\n [type] => ondeckSpecial\n )\n\n
48
+ \ [first] => \n [transformer] => Closure Object\n (\n [parameter]
49
+ => Array\n (\n [$entry] => <required>\n
50
+ \ )\n\n )\n\n)\n{\"data\":[{\"id\":\"237\",\"title\":\"Kangaroo
51
+ Island Adventure Tours - Only $410pp in February\",\"url\":\"http:\\/\\/local.content-network.dev\\/ondeck\\/kangaroo-island-adventure-tours-only-410pp-in-february\\/\",\"date\":{\"date\":\"2016-02-01
52
+ 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"Australia\\/Sydney\"},\"dateTime\":null,\"postDate\":{\"date\":\"2016-02-15
53
+ 17:48:00.000000\",\"timezone_type\":3,\"timezone\":\"Australia\\/Sydney\"},\"excerptText\":\"Save
54
+ $26 this month when you book and travel on the 2 day Kangaroo Island Wilderness
55
+ Explorer with Kangaroo Island Adventure Tours. Stay at Vivonne Bay Lodge,
56
+ located on a 206 hectare private bush property.\",\"body\":\"<p>.<\\/p>\",\"bodyMatrix\":[],\"entryOrder\":\"0\",\"faqQuestionsAnswers\":null,\"featuredEntry\":\"0\",\"googleMapIframe\":null,\"locationName\":null,\"productPrice\":null,\"regionTitle\":null,\"slideDuration\":null,\"subtitle\":null,\"time\":null,\"tourOperatingDetails\":null,\"youtubeIframe\":null,\"bannerImage\":[],\"bannerTextLine1\":null,\"bannerTextLine2\":null,\"bannerTextLine3\":null,\"bannerTextLine4\":null,\"hyperlink\":[{\"linkURL\":\"https:\\/\\/www.kiadventuretours.com.au\\/tours\\/2-day-wilderness-explorer?utm_source=ondeck&utm_medium=referral&utm_campaign=%24410%20February%202016%20Special\",\"linkText\":\"2
57
+ Day Kangaroo Island Wilderness Explorer - Kangaroo Island Adventure Tours\",\"linkTitle\":\"2
58
+ Day Kangaroo Island Wilderness Explorer - Kangaroo Island Adventure Tours\",\"linkTarget\":\"_blank\",\"linkRelations\":\"\"}],\"featureImage\":[{\"url\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/KIAT-410-February-Special.jpg\",\"title\":\"Kiat
59
+ 410 February Special\",\"small\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_small\\/KIAT-410-February-Special.jpg\",\"medium\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_medium\\/KIAT-410-February-Special.jpg\",\"large\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_large\\/KIAT-410-February-Special.jpg\",\"thumbnail180\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_thumbnail180\\/KIAT-410-February-Special.jpg\",\"thumbnail600\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_thumbnail600\\/KIAT-410-February-Special.jpg\"}],\"imageGallery\":[],\"packageDetails\":[],\"promotionalSlides\":[],\"regionThumbnail\":[],\"sectionName\":\"OnDeck\",\"sectionHandle\":\"ondeck\",\"typeName\":\"Special\",\"typeHandle\":\"ondeckSpecial\",\"jsonUrl\":\"http:\\/\\/local.content-network.dev\\/zapi\\/v1\\/Entry\\/ondeck\\/ondeckSpecial\\/237.json\\/\"},{\"id\":\"62\",\"title\":\"3
60
+ Day Limestone Coast Discovery Tour Special\",\"url\":\"http:\\/\\/local.content-network.dev\\/ondeck\\/concert-in-the-caves\\/\",\"date\":{\"date\":\"2015-12-26
61
+ 00:00:00.000000\",\"timezone_type\":3,\"timezone\":\"Australia\\/Sydney\"},\"dateTime\":null,\"postDate\":{\"date\":\"2016-01-12
62
+ 11:13:00.000000\",\"timezone_type\":3,\"timezone\":\"Australia\\/Sydney\"},\"excerptText\":\"Tour
63
+ departs from Adelaide on 4 March 2016 - $895 per person twin share.\",\"body\":\"<p><strong>3
64
+ Day Limestone Coast&nbsp;<\\/strong><strong>Discovery Tour&nbsp;<\\/strong><\\/p>\\r\\n\\r\\n<p>Tour
65
+ departs from Adelaide on 4 March 2016&nbsp;$895 per person twin share.<\\/p>\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n<p>Join
66
+ the&nbsp;<a href=\\\"http:\\/\\/email.sealinktravelgroup.com.au\\/t\\/r-l-vvjko-l-y\\/\\\">Australian
67
+ Holiday Centre<\\/a>&nbsp;as they explore the Limestone Coast in South Australia
68
+ on this 3 day trip. On the second night, you'll be treated to a special concert&nbsp;held
69
+ in the natural amphitheatre of the world-heritage listed Naracoorte Caves.
70
+ Concert stars David Hobson, ably supported by the Opera Scholars Australia.<br><\\/p>\",\"bodyMatrix\":[],\"entryOrder\":\"0\",\"faqQuestionsAnswers\":null,\"featuredEntry\":\"0\",\"googleMapIframe\":null,\"locationName\":null,\"productPrice\":null,\"regionTitle\":null,\"slideDuration\":null,\"subtitle\":null,\"time\":null,\"tourOperatingDetails\":null,\"youtubeIframe\":null,\"bannerImage\":[],\"bannerTextLine1\":null,\"bannerTextLine2\":null,\"bannerTextLine3\":null,\"bannerTextLine4\":null,\"hyperlink\":[{\"linkURL\":\"http:\\/\\/email.sealinktravelgroup.com.au\\/t\\/r-l-vvjko-l-j\\/\",\"linkText\":\"Link
71
+ Text\",\"linkTitle\":\"View Email Offer\",\"linkTarget\":\"_blank\",\"linkRelations\":\"\"}],\"featureImage\":[{\"url\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/cave.jpg\",\"title\":\"Cave\",\"small\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_small\\/cave.jpg\",\"medium\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_medium\\/cave.jpg\",\"large\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_large\\/cave.jpg\",\"thumbnail180\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_thumbnail180\\/cave.jpg\",\"thumbnail600\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/Specials\\/_thumbnail600\\/cave.jpg\"}],\"imageGallery\":[{\"url\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/MagneticIsland1.jpg\",\"title\":\"Magnetic
72
+ Island\",\"small\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_small\\/MagneticIsland1.jpg\",\"medium\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_medium\\/MagneticIsland1.jpg\",\"large\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_large\\/MagneticIsland1.jpg\",\"thumbnail180\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_thumbnail180\\/MagneticIsland1.jpg\",\"thumbnail600\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_thumbnail600\\/MagneticIsland1.jpg\"},{\"url\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/PSMurrayPrincessHeaderImage.jpg\",\"title\":\"Murray
73
+ Princess Header Image\",\"small\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_small\\/PSMurrayPrincessHeaderImage.jpg\",\"medium\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_medium\\/PSMurrayPrincessHeaderImage.jpg\",\"large\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_large\\/PSMurrayPrincessHeaderImage.jpg\",\"thumbnail180\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_thumbnail180\\/PSMurrayPrincessHeaderImage.jpg\",\"thumbnail600\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_thumbnail600\\/PSMurrayPrincessHeaderImage.jpg\"},{\"url\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg\",\"title\":\"Cafc23df
74
+ 7b64 49a5 8130 B6848f569da4\",\"small\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_small\\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg\",\"medium\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_medium\\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg\",\"large\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_large\\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg\",\"thumbnail180\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_thumbnail180\\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg\",\"thumbnail600\":\"https:\\/\\/s3-ap-southeast-2.amazonaws.com\\/akil-doc-migration-test\\/OnDeck\\/_thumbnail600\\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg\"}],\"packageDetails\":[],\"promotionalSlides\":[],\"regionThumbnail\":[],\"sectionName\":\"OnDeck\",\"sectionHandle\":\"ondeck\",\"typeName\":\"Special\",\"typeHandle\":\"ondeckSpecial\",\"jsonUrl\":\"http:\\/\\/local.content-network.dev\\/zapi\\/v1\\/Entry\\/ondeck\\/ondeckSpecial\\/62.json\\/\"}],\"meta\":{\"pagination\":{\"total\":2,\"count\":2,\"per_page\":2,\"current_page\":1,\"total_pages\":1,\"links\":[]}}}"
75
+ http_version:
76
+ recorded_at: Tue, 23 Feb 2016 06:28:47 GMT
77
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,68 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://local.content-network.dev/zapi/v1/Entry/ondeck/ondeckEdition/all?page=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - local.content-network.dev
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx/1.9.11
25
+ Date:
26
+ - Tue, 23 Feb 2016 06:25:04 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - CraftSessionId=1hjgs6jlih9j8h2t7oior26j02; path=/; domain=local.content-network.dev;
35
+ HttpOnly
36
+ X-Powered-By:
37
+ - Craft CMS
38
+ Expires:
39
+ - Tue, 16 Feb 2016 06:25:04 GMT
40
+ Pragma:
41
+ - no-cache
42
+ Cache-Control:
43
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"data":[{"id":"256","title":"Captain Cook 7 Day Sale","url":"http:\/\/local.content-network.dev\/ondeck\/captain-cook-7-day-sale\/","date":{"date":"2016-02-18
47
+ 00:00:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"dateTime":null,"postDate":{"date":"2016-02-18
48
+ 13:39:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"excerptText":"Gold
49
+ Diner Specials, Stradbroke Island Saturday Sunrise Specials, Deals on Kangaroo
50
+ Island Adventure Tours and more!","body":"<p>Gold Diner Specials, Stradbroke
51
+ Island Saturday Sunrise&nbsp;Specials, Deals on Kangaroo Island Adventure
52
+ Tours and more!<\/p>","bodyMatrix":[],"entryOrder":"0","faqQuestionsAnswers":null,"featuredEntry":"0","googleMapIframe":null,"locationName":null,"productPrice":null,"regionTitle":null,"slideDuration":null,"subtitle":null,"time":null,"tourOperatingDetails":null,"youtubeIframe":null,"bannerImage":[],"bannerTextLine1":null,"bannerTextLine2":null,"bannerTextLine3":null,"bannerTextLine4":null,"hyperlink":[{"linkURL":"http:\/\/us12.campaign-archive1.com\/?u=5e99feac3ddcbafe28281a69d&id=719f6d44e8","linkText":"OnDeck
53
+ - Edition 8","linkTitle":"Gold Diner Specials, Stradbroke Island Saturday
54
+ Packages, Deals on Kangaroo Island Adventure Tours and more!","linkTarget":"_blank","linkRelations":""}],"featureImage":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/037053-Cylinder-Beach-600w.jpg","title":"037053 Cylinder Beach
55
+ 600w","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/037053-Cylinder-Beach-600w.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/037053-Cylinder-Beach-600w.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/037053-Cylinder-Beach-600w.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/037053-Cylinder-Beach-600w.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/037053-Cylinder-Beach-600w.jpg"}],"imageGallery":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/037053-Cylinder-Beach-600w.jpg","title":"037053 Cylinder Beach
56
+ 600w","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/037053-Cylinder-Beach-600w.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/037053-Cylinder-Beach-600w.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/037053-Cylinder-Beach-600w.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/037053-Cylinder-Beach-600w.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/037053-Cylinder-Beach-600w.jpg"}],"packageDetails":[],"promotionalSlides":[],"regionThumbnail":[],"sectionName":"OnDeck","sectionHandle":"ondeck","typeName":"Edition","typeHandle":"ondeckEdition","jsonUrl":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckEdition\/256.json\/"},{"id":"104","title":"Great
57
+ deals on Australian and overseas travel.","url":"http:\/\/local.content-network.dev\/ondeck\/great-deals-on-australian-and-overseas-travel\/","date":{"date":"2016-01-21
58
+ 00:00:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"dateTime":null,"postDate":{"date":"2016-01-21
59
+ 15:28:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"excerptText":"7-Day
60
+ Hot Deals from Captain Cook Cruises and overseas travel with Australian Holiday
61
+ Centre. Plus your chance to win ticket to the movie Brooklyn.","body":"<p>7-Day
62
+ Hot Deals from Captain Cook Cruises and overseas travel with Australian Holiday
63
+ Centre. Plus your chance to win tickets to the movie Brooklyn.<\/p>","bodyMatrix":[],"entryOrder":"0","faqQuestionsAnswers":null,"featuredEntry":"0","googleMapIframe":null,"locationName":null,"productPrice":null,"regionTitle":null,"slideDuration":null,"subtitle":null,"time":null,"tourOperatingDetails":null,"youtubeIframe":null,"bannerImage":[],"bannerTextLine1":null,"bannerTextLine2":null,"bannerTextLine3":null,"bannerTextLine4":null,"hyperlink":[{"linkURL":"http:\/\/us12.campaign-archive2.com\/?u=5e99feac3ddcbafe28281a69d&id=0c90ae4c35","linkText":null,"linkTitle":"View
64
+ onDeck Email","linkTarget":"_blank","linkRelations":""}],"featureImage":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/sydney-harbour-jason-600w4.jpg","title":"Sydney
65
+ Harbour","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/sydney-harbour-jason-600w4.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/sydney-harbour-jason-600w4.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/sydney-harbour-jason-600w4.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/sydney-harbour-jason-600w4.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/sydney-harbour-jason-600w4.jpg"}],"imageGallery":[],"packageDetails":[],"promotionalSlides":[],"regionThumbnail":[],"sectionName":"OnDeck","sectionHandle":"ondeck","typeName":"Edition","typeHandle":"ondeckEdition","jsonUrl":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckEdition\/104.json\/"}],"meta":{"pagination":{"total":8,"count":2,"per_page":2,"current_page":1,"total_pages":4,"links":{"next":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckEdition\/all\/?page=2"}}}}'
66
+ http_version:
67
+ recorded_at: Tue, 23 Feb 2016 06:25:04 GMT
68
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://local.content-network.dev/zapi/v1/Entry/ondeck/ondeckEdition/all?page=2
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - local.content-network.dev
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx/1.9.11
25
+ Date:
26
+ - Tue, 23 Feb 2016 06:25:04 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - CraftSessionId=r9r2o88n7h2vu9e86dp3ke7i85; path=/; domain=local.content-network.dev;
35
+ HttpOnly
36
+ X-Powered-By:
37
+ - Craft CMS
38
+ Expires:
39
+ - Tue, 16 Feb 2016 06:25:04 GMT
40
+ Pragma:
41
+ - no-cache
42
+ Cache-Control:
43
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"data":[{"id":"95","title":"Christmas is over, now your holiday can
47
+ begin!","url":"http:\/\/local.content-network.dev\/ondeck\/christmas-is-over-now-your-holiday-can-begin\/","date":{"date":"2015-12-26
48
+ 00:00:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"dateTime":null,"postDate":{"date":"2016-01-21
49
+ 12:38:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"excerptText":"Concert
50
+ in the Caves; Save 10% on Kangaroo Island Packages^","body":"<p>Concert
51
+ in the Caves; &nbsp;Save 10% &nbsp;on Kangaroo Island Packages^<\/p>","bodyMatrix":[],"entryOrder":"0","faqQuestionsAnswers":null,"featuredEntry":"0","googleMapIframe":null,"locationName":null,"productPrice":null,"regionTitle":null,"slideDuration":null,"subtitle":null,"time":null,"tourOperatingDetails":null,"youtubeIframe":null,"bannerImage":[],"bannerTextLine1":null,"bannerTextLine2":null,"bannerTextLine3":null,"bannerTextLine4":null,"hyperlink":[{"linkURL":"http:\/\/email.sealinktravelgroup.com.au\/t\/r-e-vvjko-l-jr\/","linkText":null,"linkTitle":"View
52
+ onDeck Email","linkTarget":"_blank","linkRelations":""}],"featureImage":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/post-xmas1.jpg","title":"After
53
+ Christmas","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/post-xmas1.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/post-xmas1.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/post-xmas1.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/post-xmas1.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/post-xmas1.jpg"}],"imageGallery":[],"packageDetails":[],"promotionalSlides":[],"regionThumbnail":[],"sectionName":"OnDeck","sectionHandle":"ondeck","typeName":"Edition","typeHandle":"ondeckEdition","jsonUrl":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckEdition\/95.json\/"},{"id":"92","title":"PS
54
+ Murray Princess Cruise Specials","url":"http:\/\/local.content-network.dev\/ondeck\/ps-murray-princess-cruise-specials\/","date":{"date":"2015-12-18
55
+ 00:00:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"dateTime":null,"postDate":{"date":"2016-01-21
56
+ 12:33:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"excerptText":"Bonus
57
+ Cabin Upgrades and $100 Bar Vouchers on PS Murray Princess in January 2016","body":"<p>Bonus
58
+ Cabin Upgrades and $100 Bar Vouchers on PS Murray Princess in January 2016<\/p>","bodyMatrix":[],"entryOrder":"0","faqQuestionsAnswers":null,"featuredEntry":"0","googleMapIframe":null,"locationName":null,"productPrice":null,"regionTitle":null,"slideDuration":null,"subtitle":null,"time":null,"tourOperatingDetails":null,"youtubeIframe":null,"bannerImage":[],"bannerTextLine1":null,"bannerTextLine2":null,"bannerTextLine3":null,"bannerTextLine4":null,"hyperlink":[{"linkURL":"http:\/\/email.sealinktravelgroup.com.au\/t\/r-e-vlkydhd-l-jl\/","linkText":null,"linkTitle":"View
59
+ onDeck Email","linkTarget":"_blank","linkRelations":""}],"featureImage":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/PSMurrayPrincessHeaderImage.jpg","title":"Murray
60
+ Princess Header Image","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/PSMurrayPrincessHeaderImage.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/PSMurrayPrincessHeaderImage.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/PSMurrayPrincessHeaderImage.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/PSMurrayPrincessHeaderImage.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/PSMurrayPrincessHeaderImage.jpg"}],"imageGallery":[],"packageDetails":[],"promotionalSlides":[],"regionThumbnail":[],"sectionName":"OnDeck","sectionHandle":"ondeck","typeName":"Edition","typeHandle":"ondeckEdition","jsonUrl":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckEdition\/92.json\/"}],"meta":{"pagination":{"total":8,"count":2,"per_page":2,"current_page":2,"total_pages":4,"links":{"previous":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckEdition\/all\/?page=1","next":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckEdition\/all\/?page=3"}}}}'
61
+ http_version:
62
+ recorded_at: Tue, 23 Feb 2016 06:25:04 GMT
63
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://local.content-network.dev/zapi/v1/Entry/ondeck/ondeckSpecial/all?page=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Host:
17
+ - local.content-network.dev
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx/1.9.11
25
+ Date:
26
+ - Tue, 23 Feb 2016 06:25:04 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - CraftSessionId=ru0sicbu2j56ppmhcnfpdumgj6; path=/; domain=local.content-network.dev;
35
+ HttpOnly
36
+ X-Powered-By:
37
+ - Craft CMS
38
+ Expires:
39
+ - Tue, 16 Feb 2016 06:25:04 GMT
40
+ Pragma:
41
+ - no-cache
42
+ Cache-Control:
43
+ - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"data":[{"id":"237","title":"Kangaroo Island Adventure Tours - Only
47
+ $410pp in February","url":"http:\/\/local.content-network.dev\/ondeck\/kangaroo-island-adventure-tours-only-410pp-in-february\/","date":{"date":"2016-02-01
48
+ 00:00:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"dateTime":null,"postDate":{"date":"2016-02-15
49
+ 17:48:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"excerptText":"Save
50
+ $26 this month when you book and travel on the 2 day Kangaroo Island Wilderness
51
+ Explorer with Kangaroo Island Adventure Tours. Stay at Vivonne Bay Lodge,
52
+ located on a 206 hectare private bush property.","body":"<p>.<\/p>","bodyMatrix":[],"entryOrder":"0","faqQuestionsAnswers":null,"featuredEntry":"0","googleMapIframe":null,"locationName":null,"productPrice":null,"regionTitle":null,"slideDuration":null,"subtitle":null,"time":null,"tourOperatingDetails":null,"youtubeIframe":null,"bannerImage":[],"bannerTextLine1":null,"bannerTextLine2":null,"bannerTextLine3":null,"bannerTextLine4":null,"hyperlink":[{"linkURL":"https:\/\/www.kiadventuretours.com.au\/tours\/2-day-wilderness-explorer?utm_source=ondeck&utm_medium=referral&utm_campaign=%24410%20February%202016%20Special","linkText":"2
53
+ Day Kangaroo Island Wilderness Explorer - Kangaroo Island Adventure Tours","linkTitle":"2
54
+ Day Kangaroo Island Wilderness Explorer - Kangaroo Island Adventure Tours","linkTarget":"_blank","linkRelations":""}],"featureImage":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/KIAT-410-February-Special.jpg","title":"Kiat
55
+ 410 February Special","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_small\/KIAT-410-February-Special.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_medium\/KIAT-410-February-Special.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_large\/KIAT-410-February-Special.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_thumbnail180\/KIAT-410-February-Special.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_thumbnail600\/KIAT-410-February-Special.jpg"}],"imageGallery":[],"packageDetails":[],"promotionalSlides":[],"regionThumbnail":[],"sectionName":"OnDeck","sectionHandle":"ondeck","typeName":"Special","typeHandle":"ondeckSpecial","jsonUrl":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckSpecial\/237.json\/"},{"id":"62","title":"3
56
+ Day Limestone Coast Discovery Tour Special","url":"http:\/\/local.content-network.dev\/ondeck\/concert-in-the-caves\/","date":{"date":"2015-12-26
57
+ 00:00:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"dateTime":null,"postDate":{"date":"2016-01-12
58
+ 11:13:00.000000","timezone_type":3,"timezone":"Australia\/Sydney"},"excerptText":"Tour
59
+ departs from Adelaide on 4 March 2016 - $895 per person twin share.","body":"<p><strong>3
60
+ Day Limestone Coast&nbsp;<\/strong><strong>Discovery Tour&nbsp;<\/strong><\/p>\r\n\r\n<p>Tour
61
+ departs from Adelaide on 4 March 2016&nbsp;$895 per person twin share.<\/p>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<p>Join
62
+ the&nbsp;<a href=\"http:\/\/email.sealinktravelgroup.com.au\/t\/r-l-vvjko-l-y\/\">Australian
63
+ Holiday Centre<\/a>&nbsp;as they explore the Limestone Coast in South Australia
64
+ on this 3 day trip. On the second night, you''ll be treated to a special concert&nbsp;held
65
+ in the natural amphitheatre of the world-heritage listed Naracoorte Caves.
66
+ Concert stars David Hobson, ably supported by the Opera Scholars Australia.<br><\/p>","bodyMatrix":[],"entryOrder":"0","faqQuestionsAnswers":null,"featuredEntry":"0","googleMapIframe":null,"locationName":null,"productPrice":null,"regionTitle":null,"slideDuration":null,"subtitle":null,"time":null,"tourOperatingDetails":null,"youtubeIframe":null,"bannerImage":[],"bannerTextLine1":null,"bannerTextLine2":null,"bannerTextLine3":null,"bannerTextLine4":null,"hyperlink":[{"linkURL":"http:\/\/email.sealinktravelgroup.com.au\/t\/r-l-vvjko-l-j\/","linkText":"Link
67
+ Text","linkTitle":"View Email Offer","linkTarget":"_blank","linkRelations":""}],"featureImage":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/cave.jpg","title":"Cave","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_small\/cave.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_medium\/cave.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_large\/cave.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_thumbnail180\/cave.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/Specials\/_thumbnail600\/cave.jpg"}],"imageGallery":[{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/MagneticIsland1.jpg","title":"Magnetic
68
+ Island","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/MagneticIsland1.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/MagneticIsland1.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/MagneticIsland1.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/MagneticIsland1.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/MagneticIsland1.jpg"},{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/PSMurrayPrincessHeaderImage.jpg","title":"Murray
69
+ Princess Header Image","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/PSMurrayPrincessHeaderImage.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/PSMurrayPrincessHeaderImage.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/PSMurrayPrincessHeaderImage.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/PSMurrayPrincessHeaderImage.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/PSMurrayPrincessHeaderImage.jpg"},{"url":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg","title":"Cafc23df
70
+ 7b64 49a5 8130 B6848f569da4","small":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_small\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg","medium":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_medium\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg","large":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_large\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg","thumbnail180":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail180\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg","thumbnail600":"https:\/\/s3-ap-southeast-2.amazonaws.com\/akil-doc-migration-test\/OnDeck\/_thumbnail600\/cafc23df-7b64-49a5-8130-b6848f569da4.jpg"}],"packageDetails":[],"promotionalSlides":[],"regionThumbnail":[],"sectionName":"OnDeck","sectionHandle":"ondeck","typeName":"Special","typeHandle":"ondeckSpecial","jsonUrl":"http:\/\/local.content-network.dev\/zapi\/v1\/Entry\/ondeck\/ondeckSpecial\/62.json\/"}],"meta":{"pagination":{"total":2,"count":2,"per_page":2,"current_page":1,"total_pages":1,"links":[]}}}'
71
+ http_version:
72
+ recorded_at: Tue, 23 Feb 2016 06:25:04 GMT
73
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,107 @@
1
+ require 'spec_helper'
2
+
3
+ describe ContentNetwork::EntriesFetcher do
4
+ let(:api_endpoint_entry) { 'http://local.content-network.dev/zapi/v1/' }
5
+ let(:total_specials) { 2 }
6
+ let(:total_editions) { 8 }
7
+ let(:limit) { 2 }
8
+
9
+ before do
10
+ ContentNetwork.base_uri api_endpoint_entry
11
+ end
12
+
13
+ let(:fetcher) { ContentNetwork::EntriesFetcher.new(params, pagination_params) }
14
+ let(:pagination_params) { {} }
15
+
16
+ context 'when editions params' do
17
+ subject(:collection) { VCR.use_cassette('fetch_editions') { fetcher.fetch } }
18
+
19
+ let(:params) {
20
+ {
21
+ element_type: 'Entry',
22
+ section_name: 'ondeck',
23
+ entry_type: 'ondeckEdition'
24
+ }
25
+ }
26
+
27
+ its(:error?) { should be false }
28
+
29
+ context 'its pagination' do
30
+ subject(:pagination) { collection.pagination }
31
+ specify { expect(pagination['count']).to eq limit }
32
+ specify { expect(pagination['total']).to eq total_editions }
33
+ specify { expect(pagination['current_page']).to eq 1 }
34
+ end
35
+
36
+ context 'its data' do
37
+ subject(:data) { collection.data }
38
+ it { should be_an_instance_of Array }
39
+ its(:size) { should eq limit }
40
+
41
+ context 'the editions' do
42
+ let(:edition_ids) { data.map { |edition| edition['id'] } }
43
+ specify { expect(edition_ids).to eq ['256', '104'] }
44
+ end
45
+ end
46
+
47
+ context 'when paginating' do
48
+ subject(:collection) { VCR.use_cassette('fetch_editions_with_pagination') { fetcher.fetch } }
49
+
50
+ let(:pagination_params) { { page: 2 } }
51
+
52
+ context 'its pagination' do
53
+ subject(:pagination) { collection.pagination }
54
+ specify { expect(pagination['count']).to eq limit }
55
+ specify { expect(pagination['total']).to eq total_editions }
56
+ specify { expect(pagination['current_page']).to eq 2 }
57
+ end
58
+
59
+ context 'its data' do
60
+ subject(:data) { collection.data }
61
+ it { should be_an_instance_of Array }
62
+ its(:size) { should eq limit }
63
+
64
+ context 'the editions' do
65
+ let(:edition_ids) { data.map { |edition| edition['id'] } }
66
+ specify { expect(edition_ids).to eq ['95', '92'] }
67
+ end
68
+ end
69
+ end
70
+ end
71
+
72
+ context 'when specials params' do
73
+ subject(:collection) { VCR.use_cassette('fetch_specials') { fetcher.fetch } }
74
+
75
+ let(:params) {
76
+ {
77
+ element_type: 'Entry',
78
+ section_name: 'ondeck',
79
+ entry_type: 'ondeckSpecial'
80
+ }
81
+ }
82
+
83
+ its(:error?) { should be false }
84
+
85
+ context 'its data' do
86
+ subject(:data) { collection.data }
87
+ it { should be_an_instance_of Array }
88
+ its(:size) { should eq total_specials }
89
+ end
90
+ end
91
+
92
+ context 'when content network down' do
93
+ subject(:collection) { VCR.use_cassette('fetch_down') { fetcher.fetch } }
94
+
95
+ let(:params) {
96
+ {
97
+ element_type: 'Entry',
98
+ section_name: 'ondeck',
99
+ entry_type: 'ondeckSpecial'
100
+ }
101
+ }
102
+
103
+ its(:error?) { should be true }
104
+ its(:error) { should match /unexpected token/ }
105
+ its(:data) { should be nil }
106
+ end
107
+ end
@@ -0,0 +1,9 @@
1
+ require 'rspec/its'
2
+
3
+ require 'facets/hash/slice'
4
+ require 'facets/kernel/blank'
5
+
6
+ require 'support/vcr_loader'
7
+ require 'support/coverage_loader'
8
+
9
+ require 'content_network'
@@ -0,0 +1,26 @@
1
+ MINIMUM_COVERAGE = 100
2
+
3
+ unless ENV['COVERAGE'] == 'off'
4
+ require 'simplecov'
5
+ require 'simplecov-rcov'
6
+ require 'coveralls'
7
+ Coveralls.wear!
8
+
9
+ SimpleCov.formatters = [
10
+ SimpleCov::Formatter::RcovFormatter,
11
+ Coveralls::SimpleCov::Formatter
12
+ ]
13
+ SimpleCov.start do
14
+ add_filter '/vendor/'
15
+ add_filter '/spec/'
16
+ add_group 'lib', 'lib'
17
+ end
18
+ SimpleCov.at_exit do
19
+ SimpleCov.result.format!
20
+ percent = SimpleCov.result.covered_percent
21
+ unless percent >= MINIMUM_COVERAGE
22
+ puts "Coverage must be above #{MINIMUM_COVERAGE}%. It is #{"%.2f" % percent}%"
23
+ Kernel.exit(1)
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,6 @@
1
+ require 'vcr'
2
+
3
+ VCR.configure do |c|
4
+ c.cassette_library_dir = 'spec/cassettes'
5
+ c.hook_into :webmock
6
+ end
metadata ADDED
@@ -0,0 +1,240 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: content_network
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Michael Noack
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: facets
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-its
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: vcr
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: webmock
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov-rcov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: coveralls
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: travis
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: pry-byebug
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ description: Integrate with SeaLink's content network provider.
182
+ email:
183
+ - support@travellink.com.au
184
+ executables: []
185
+ extensions: []
186
+ extra_rdoc_files: []
187
+ files:
188
+ - ".gitignore"
189
+ - ".travis.yml"
190
+ - Gemfile
191
+ - README.md
192
+ - Rakefile
193
+ - content_network.gemspec
194
+ - lib/content_network.rb
195
+ - lib/content_network/collection.rb
196
+ - lib/content_network/entries_fetcher.rb
197
+ - lib/content_network/pagination_params.rb
198
+ - lib/content_network/path_params.rb
199
+ - lib/content_network/version.rb
200
+ - spec/cassettes/fetch_down.yml
201
+ - spec/cassettes/fetch_editions.yml
202
+ - spec/cassettes/fetch_editions_with_pagination.yml
203
+ - spec/cassettes/fetch_specials.yml
204
+ - spec/entries_fetcher_spec.rb
205
+ - spec/spec_helper.rb
206
+ - spec/support/coverage_loader.rb
207
+ - spec/support/vcr_loader.rb
208
+ homepage: http://github.com/sealink/content_network
209
+ licenses:
210
+ - MIT
211
+ metadata: {}
212
+ post_install_message:
213
+ rdoc_options: []
214
+ require_paths:
215
+ - lib
216
+ required_ruby_version: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ required_rubygems_version: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
+ requirements: []
227
+ rubyforge_project:
228
+ rubygems_version: 2.4.8
229
+ signing_key:
230
+ specification_version: 4
231
+ summary: Integrate with SeaLink's content network provider.
232
+ test_files:
233
+ - spec/cassettes/fetch_down.yml
234
+ - spec/cassettes/fetch_editions.yml
235
+ - spec/cassettes/fetch_editions_with_pagination.yml
236
+ - spec/cassettes/fetch_specials.yml
237
+ - spec/entries_fetcher_spec.rb
238
+ - spec/spec_helper.rb
239
+ - spec/support/coverage_loader.rb
240
+ - spec/support/vcr_loader.rb