locomotivecms_wagon 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ describe Locomotive::Wagon::CLI do
10
10
  describe '#version' do
11
11
 
12
12
  let(:command) { Locomotive::Wagon::CLI::Main.start(['version']) }
13
- it { is_expected.to match /^2.0.0/ }
13
+ it { is_expected.to match /^2.0.1/ }
14
14
 
15
15
  end
16
16
 
@@ -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.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-01-12 00:00:00.000000000 Z
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.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.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