govuk_content_models 32.0.0 → 32.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6af733bb83f5e4d60a3c405a5492056904e47122
4
- data.tar.gz: e5f073c62dd6f5ed47794f3d25e0ea2a82fd7407
3
+ metadata.gz: e1cf903c765eb0fc8a68cc9f8924b85054c13bbd
4
+ data.tar.gz: 6d397d3891fcb8c25594a87f10d245cff6de0f06
5
5
  SHA512:
6
- metadata.gz: a94e635fc55b8526aac787f1d7f72e27e198d9f09704a7c4c577d4cd4668ebe3f3d3d78a4e5de52686c9b34dcb8ab3700801228ae6b82b822209fcae4d5a86d9
7
- data.tar.gz: 547d3b7c4ae53e4e8715e1d8e53df28190a884e112bd6349c4c3f1555c9f3f929fa04645c77258cd71c6b62b47482ffe72edc2ff02c1893b02673a7777d8b613
6
+ metadata.gz: 5c6f0b8ba9a6e550f6d0ed0de0237be9a9bc9908c39bb468c2a2ffca322a937240da7b1ed6dc90882d37afca0063223e1b45fcbe4743d2cd4a03d3607e92a1e9
7
+ data.tar.gz: d9a05ab4a03b66a0608078785e7db503a19c5bf43d613a5b3706b45054df0bf00611ef0a7fb197ed42cabaa078d8e68601e1fa3097daf239768cf95014d01c68
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 32.1.0
4
+
5
+ - Add GDS-SSO `User` linting and required `User#organisation_content_id` attribute
6
+
3
7
  ## 32.0.0
4
8
 
5
9
  - Add body and default parts to mainstream format factories
data/app/models/user.rb CHANGED
@@ -14,14 +14,15 @@ class User
14
14
  defined?(USER_COLLECTION_NAME) ? USER_COLLECTION_NAME : "users"
15
15
  end
16
16
 
17
- field "name", type: String
18
- field "uid", type: String
19
- field "version", type: Integer
20
- field "email", type: String
21
- field "permissions", type: Array
22
- field "remotely_signed_out", type: Boolean, default: false
23
- field "organisation_slug", type: String
24
- field "disabled", type: Boolean, default: false
17
+ field "name", type: String
18
+ field "uid", type: String
19
+ field "version", type: Integer
20
+ field "email", type: String
21
+ field "permissions", type: Array
22
+ field "remotely_signed_out", type: Boolean, default: false
23
+ field "organisation_slug", type: String
24
+ field "disabled", type: Boolean, default: false
25
+ field "organisation_content_id", type: String
25
26
 
26
27
  index "uid", unique: true
27
28
  index "disabled"
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency "bson_ext"
19
19
  gem.add_dependency "gds-api-adapters", ">= 10.9.0"
20
20
 
21
- gem.add_dependency "gds-sso", ">= 10.0.0"
21
+ gem.add_dependency "gds-sso", "~> 11.2"
22
22
  gem.add_dependency "govspeak", "~> 3.1"
23
23
  # Mongoid 2.5.0 supports the newer 1.7.x and 1.8.x Mongo drivers
24
24
  gem.add_dependency "mongoid", "~> 2.5"
@@ -135,7 +135,7 @@ FactoryGirl.define do
135
135
  factory :video_edition, traits: [:with_body], parent: :edition, :class => 'VideoEdition' do
136
136
  end
137
137
 
138
- factory :business_support_edition, :parent => :edition, :class => "BusinessSupportEdition" do
138
+ factory :business_support_edition, traits: [:with_body], :parent => :edition, :class => "BusinessSupportEdition" do
139
139
  end
140
140
 
141
141
  factory :guide_edition, :parent => :edition, :class => "GuideEdition" do
@@ -194,6 +194,8 @@ FactoryGirl.define do
194
194
 
195
195
  factory :licence_edition, :parent => :edition, :class => "LicenceEdition" do
196
196
  licence_identifier "AB1234"
197
+ licence_short_description "This is a licence short description."
198
+ licence_overview "This is a licence overview."
197
199
  end
198
200
 
199
201
  factory :local_service do |ls|
@@ -1,4 +1,4 @@
1
1
  module GovukContentModels
2
2
  # Changing this causes Jenkins to tag and release the gem into the wild
3
- VERSION = "32.0.0"
3
+ VERSION = "32.1.0"
4
4
  end
@@ -57,7 +57,7 @@ class LicenceEditionTest < ActiveSupport::TestCase
57
57
  assert_equal 'wibble', new_version.licence_identifier
58
58
  assert new_version.valid?, "Expected clone to be valid"
59
59
  end
60
-
60
+
61
61
  should "not validate the continuation link when blank" do
62
62
  @l.continuation_link = ""
63
63
  assert @l.valid?, "continuation link validation should not be triggered when the field is blank"
@@ -92,13 +92,13 @@ class LicenceEditionTest < ActiveSupport::TestCase
92
92
 
93
93
  context "indexable_content" do
94
94
  should "include the licence_overview, removing markup" do
95
- licence = FactoryGirl.create(:licence_edition, licence_overview: "## Overview")
96
- assert_equal "Overview", licence.indexable_content
95
+ licence = FactoryGirl.create(:licence_edition)
96
+ assert_includes licence.indexable_content, "This is a licence overview"
97
97
  end
98
98
 
99
99
  should "include the licence_short_description" do
100
- licence = FactoryGirl.create(:licence_edition, licence_short_description: "Short desc")
101
- assert_equal "Short desc", licence.indexable_content
100
+ licence = FactoryGirl.create(:licence_edition)
101
+ assert_includes licence.indexable_content, "This is a licence short description."
102
102
  end
103
103
  end
104
104
  end
@@ -1,4 +1,11 @@
1
1
  require "test_helper"
2
+ require "gds-sso/lint/user_test"
3
+
4
+ class GDS::SSO::Lint::UserTest
5
+ def user_class
6
+ ::User
7
+ end
8
+ end
2
9
 
3
10
  class UserTest < ActiveSupport::TestCase
4
11
  def setup
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_content_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 32.0.0
4
+ version: 32.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Battley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-05 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bson_ext
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: gds-sso
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 10.0.0
47
+ version: '11.2'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 10.0.0
54
+ version: '11.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: govspeak
57
57
  requirement: !ruby/object:Gem::Requirement