locomotivecms_wagon 2.0.0.rc5 → 2.0.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/generators/blank/config/deploy.yml +2 -1
- data/generators/bootstrap/config/deploy.yml +2 -1
- data/lib/locomotive/wagon/commands/push_command.rb +1 -1
- data/lib/locomotive/wagon/decorators/content_entry_decorator.rb +1 -1
- data/lib/locomotive/wagon/version.rb +1 -1
- data/locomotivecms_wagon.gemspec +2 -2
- data/spec/unit/decorators/content_entry_decorator_spec.rb +70 -0
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f762fee2b5e2a55c9000323e814145d6c09cf732
|
4
|
+
data.tar.gz: 7ff6dbc6a2d00eb28b4e2259db598c442eabb7e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dea5e635c441886ecf9231bbd7549f1991d0867e16df9761fc8aeda5dddb48f93cd733029e46b8eb2c28fa67d55a5b8f13104dc838a9443b1cc974ef252c75a1
|
7
|
+
data.tar.gz: e26b8a68906b25cfd1f8d1c78669fcd49fc9382f8b02aa67aa8843068dca0f5cceaa5cc44ae8263c081e5c7265522771da476e269fb9fd9310447ff66a1aa8da
|
data/locomotivecms_wagon.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |gem|
|
|
27
27
|
gem.add_dependency 'netrc', '~> 0.10.3'
|
28
28
|
|
29
29
|
gem.add_dependency 'locomotivecms_common', '~> 0.0.5'
|
30
|
-
gem.add_dependency 'locomotivecms_coal', '~> 1.0.0.
|
31
|
-
gem.add_dependency 'locomotivecms_steam', '~> 1.0.0.
|
30
|
+
gem.add_dependency 'locomotivecms_coal', '~> 1.0.0.rc4'
|
31
|
+
gem.add_dependency 'locomotivecms_steam', '~> 1.0.0.rc9'
|
32
32
|
|
33
33
|
gem.add_dependency 'listen', '~> 3.0.4'
|
34
34
|
gem.add_dependency 'rack-livereload', '~> 0.3.16'
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
require 'chronic'
|
6
|
+
require 'locomotive/steam'
|
7
|
+
require 'locomotive/wagon/decorators/concerns/to_hash_concern'
|
8
|
+
require 'locomotive/wagon/decorators/concerns/persist_assets_concern'
|
9
|
+
require 'locomotive/wagon/decorators/content_entry_decorator'
|
10
|
+
|
11
|
+
describe Locomotive::Wagon::ContentEntryDecorator do
|
12
|
+
|
13
|
+
let(:content_type) { instance_double('ContentType', fields: fields) }
|
14
|
+
let(:entry) { instance_double('ContentEntry', attributes.merge(content_type: content_type, localized_attributes: [])) }
|
15
|
+
let(:decorator) { described_class.new(entry, 'en', '.') }
|
16
|
+
|
17
|
+
before { allow(decorator).to receive(:_slug).and_return('sample') }
|
18
|
+
|
19
|
+
describe '#to_hash' do
|
20
|
+
|
21
|
+
describe 'no field' do
|
22
|
+
|
23
|
+
let(:fields) { instance_double('Fields', by_name: nil, no_associations: []) }
|
24
|
+
let(:attributes) { {} }
|
25
|
+
|
26
|
+
subject { decorator.to_hash }
|
27
|
+
|
28
|
+
it { is_expected.to eq({}) }
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
describe 'string field' do
|
33
|
+
|
34
|
+
let(:field) { instance_double('Field', name: 'title', type: 'string') }
|
35
|
+
let(:fields) { instance_double('Fields', by_name: field, no_associations: [field]) }
|
36
|
+
let(:attributes) { { title: 'Hello world' } }
|
37
|
+
|
38
|
+
subject { decorator.to_hash }
|
39
|
+
|
40
|
+
it { is_expected.to eq({ _slug: 'sample', title: 'Hello world' }) }
|
41
|
+
|
42
|
+
end
|
43
|
+
|
44
|
+
describe 'date field' do
|
45
|
+
|
46
|
+
let(:field) { instance_double('Field', name: 'posted_at', type: 'date') }
|
47
|
+
let(:fields) { instance_double('Fields', by_name: field, no_associations: [field]) }
|
48
|
+
let(:attributes) { { posted_at: Chronic.parse('2015-09-26').to_date } }
|
49
|
+
|
50
|
+
subject { decorator.to_hash }
|
51
|
+
|
52
|
+
it { is_expected.to eq({ _slug: 'sample', posted_at: '2015-09-26' }) }
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
describe 'date time field' do
|
57
|
+
|
58
|
+
let(:field) { instance_double('Field', name: 'posted_at', type: 'date_time') }
|
59
|
+
let(:fields) { instance_double('Fields', by_name: field, no_associations: [field]) }
|
60
|
+
let(:attributes) { { posted_at: Chronic.parse('2015-11-11 18:00:00 +0100').to_datetime } }
|
61
|
+
|
62
|
+
subject { decorator.to_hash }
|
63
|
+
|
64
|
+
it { is_expected.to eq({ _slug: 'sample', posted_at: '2015-11-11T18:00:00+01:00' }) }
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotivecms_wagon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.rc6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -101,28 +101,28 @@ dependencies:
|
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 1.0.0.
|
104
|
+
version: 1.0.0.rc4
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 1.0.0.
|
111
|
+
version: 1.0.0.rc4
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: locomotivecms_steam
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 1.0.0.
|
118
|
+
version: 1.0.0.rc9
|
119
119
|
type: :runtime
|
120
120
|
prerelease: false
|
121
121
|
version_requirements: !ruby/object:Gem::Requirement
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: 1.0.0.
|
125
|
+
version: 1.0.0.rc9
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: listen
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -620,6 +620,7 @@ files:
|
|
620
620
|
- spec/support/vcr.rb
|
621
621
|
- spec/unit/commands/pull_sub_commands/concerns/assets_concern_spec.rb
|
622
622
|
- spec/unit/commands/push_sub_commands/push_theme_assets_command_spec.rb
|
623
|
+
- spec/unit/decorators/content_entry_decorator_spec.rb
|
623
624
|
- spec/unit/decorators/site_decorator_spec.rb
|
624
625
|
- spec/unit/decorators/theme_asset_decorator_spec.rb
|
625
626
|
homepage: http://www.locomotivecms.com
|
@@ -642,7 +643,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
642
643
|
version: 1.3.1
|
643
644
|
requirements: []
|
644
645
|
rubyforge_project:
|
645
|
-
rubygems_version: 2.5.
|
646
|
+
rubygems_version: 2.4.5.1
|
646
647
|
signing_key:
|
647
648
|
specification_version: 4
|
648
649
|
summary: The LocomotiveCMS wagon is a site generator for the LocomotiveCMS engine
|
@@ -750,5 +751,6 @@ test_files:
|
|
750
751
|
- spec/support/vcr.rb
|
751
752
|
- spec/unit/commands/pull_sub_commands/concerns/assets_concern_spec.rb
|
752
753
|
- spec/unit/commands/push_sub_commands/push_theme_assets_command_spec.rb
|
754
|
+
- spec/unit/decorators/content_entry_decorator_spec.rb
|
753
755
|
- spec/unit/decorators/site_decorator_spec.rb
|
754
756
|
- spec/unit/decorators/theme_asset_decorator_spec.rb
|