locomotivecms_wagon 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/README.md +1 -1
- data/generators/page/template.liquid.haml.tt +3 -0
- data/generators/page/template.liquid.tt +8 -2
- data/lib/locomotive/wagon.rb +4 -4
- data/lib/locomotive/wagon/cli.rb +2 -8
- data/lib/locomotive/wagon/commands/pull_sub_commands/pull_content_entries_command.rb +1 -1
- data/lib/locomotive/wagon/commands/pull_sub_commands/pull_content_types_command.rb +9 -3
- data/lib/locomotive/wagon/commands/push_sub_commands/push_site_command.rb +2 -0
- data/lib/locomotive/wagon/commands/push_sub_commands/push_snippets_command.rb +1 -1
- data/lib/locomotive/wagon/commands/serve_command.rb +74 -22
- data/lib/locomotive/wagon/decorators/content_type_field_decorator.rb +3 -3
- data/lib/locomotive/wagon/decorators/site_decorator.rb +3 -3
- data/lib/locomotive/wagon/decorators/snippet_decorator.rb +13 -5
- data/lib/locomotive/wagon/generators/page.rb +3 -1
- data/lib/locomotive/wagon/version.rb +1 -1
- data/locomotivecms_wagon.gemspec +1 -1
- data/spec/fixtures/cassettes/authenticate.yml +82 -41
- data/spec/fixtures/cassettes/delete.yml +160 -160
- data/spec/fixtures/cassettes/push.yml +1039 -1036
- data/spec/integration/cli_spec.rb +1 -1
- data/spec/unit/commands/pull_sub_commands/pull_content_types_command_spec.rb +41 -0
- metadata +6 -4
@@ -0,0 +1,41 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
require 'active_support'
|
6
|
+
require 'active_support/core_ext'
|
7
|
+
require 'locomotive/wagon/commands/pull_sub_commands/pull_base_command'
|
8
|
+
require 'locomotive/wagon/commands/pull_sub_commands/pull_content_types_command'
|
9
|
+
|
10
|
+
describe Locomotive::Wagon::PullContentTypesCommand do
|
11
|
+
|
12
|
+
let(:locales) { ['en'] }
|
13
|
+
let(:site) { instance_double('Site', locales: locales) }
|
14
|
+
let(:command) { described_class.new(nil, site, nil) }
|
15
|
+
|
16
|
+
describe '#select_options_yaml' do
|
17
|
+
|
18
|
+
subject { command.send(:select_options_yaml, options) }
|
19
|
+
|
20
|
+
context 'the site is localized' do
|
21
|
+
|
22
|
+
let(:locales) { ['en', 'fr'] }
|
23
|
+
let(:options) { [{ 'id' => '1', 'name' => { 'en' => 'team', 'fr' => 'équipe' }, 'position' => 2 }, { 'id' => '2', 'name' => { 'en' => 'accounting', 'fr' => 'compta' }, 'position' => 1 }] }
|
24
|
+
|
25
|
+
it { expect(subject['en']).to eq(['accounting', 'team']) }
|
26
|
+
it { expect(subject['fr']).to eq(['compta', 'équipe']) }
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'the site is not localized' do
|
31
|
+
|
32
|
+
let(:locales) { ['fr'] }
|
33
|
+
let(:options) { [{ 'id' => '1', 'name' => { 'fr' => 'équipe' }, 'position' => 2 }, { 'id' => '2', 'name' => {'fr' => 'compta' }, 'position' => 1 }] }
|
34
|
+
|
35
|
+
it { is_expected.to eq(['compta', 'équipe']) }
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
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.
|
4
|
+
version: 2.0.1
|
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: 2016-
|
12
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -115,14 +115,14 @@ dependencies:
|
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 1.0.
|
118
|
+
version: 1.0.1
|
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.
|
125
|
+
version: 1.0.1
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: listen
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
@@ -622,6 +622,7 @@ files:
|
|
622
622
|
- spec/support/thor.rb
|
623
623
|
- spec/support/vcr.rb
|
624
624
|
- spec/unit/commands/pull_sub_commands/concerns/assets_concern_spec.rb
|
625
|
+
- spec/unit/commands/pull_sub_commands/pull_content_types_command_spec.rb
|
625
626
|
- spec/unit/commands/push_sub_commands/push_theme_assets_command_spec.rb
|
626
627
|
- spec/unit/decorators/content_entry_decorator_spec.rb
|
627
628
|
- spec/unit/decorators/site_decorator_spec.rb
|
@@ -756,6 +757,7 @@ test_files:
|
|
756
757
|
- spec/support/thor.rb
|
757
758
|
- spec/support/vcr.rb
|
758
759
|
- spec/unit/commands/pull_sub_commands/concerns/assets_concern_spec.rb
|
760
|
+
- spec/unit/commands/pull_sub_commands/pull_content_types_command_spec.rb
|
759
761
|
- spec/unit/commands/push_sub_commands/push_theme_assets_command_spec.rb
|
760
762
|
- spec/unit/decorators/content_entry_decorator_spec.rb
|
761
763
|
- spec/unit/decorators/site_decorator_spec.rb
|