Permalink
Browse files

Fix Browse Section UI breaking curated ordering

Updating a browse section would serialise the artefacts for the curated list as
strings, not as BSON::ObjectIds. This meant that govuk_content_api was
comparing two different object types, which failed, so it would fallback to
alphabetical ordering.
  • Loading branch information...
1 parent ab0d562 commit c09274d9c5aa43fa994674a011e855f4dc32e950 @jamiecobbett jamiecobbett committed Mar 11, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −1 Gemfile
  2. +2 −2 Gemfile.lock
  3. +2 −2 test/functional/browse_sections_controller_test.rb
View
@@ -32,7 +32,7 @@ gem 'lograge', '~> 0.1.0'
if ENV['CONTENT_MODELS_DEV']
gem "govuk_content_models", path: '../govuk_content_models'
else
- gem "govuk_content_models", "4.10.0"
+ gem "govuk_content_models", "4.10.1"
end
if ENV['BUNDLE_DEV']
View
@@ -120,7 +120,7 @@ GEM
htmlentities (~> 4)
kramdown (~> 0.13.3)
sanitize (= 2.0.3)
- govuk_content_models (4.10.0)
+ govuk_content_models (4.10.1)
bson_ext
differ
gds-api-adapters
@@ -326,7 +326,7 @@ DEPENDENCIES
gds-api-adapters (= 4.1.3)
gds-sso (= 3.0.0)
gelf
- govuk_content_models (= 4.10.0)
+ govuk_content_models (= 4.10.1)
jquery-rails (= 2.0.2)
jquery-ui-rails (= 3.0.1)
launchy
@@ -107,7 +107,7 @@ def login_as_user_with_permission
put :update, id: @section.id, section: {}, curated_list: { artefact_ids: [@artefact.id, ""] }
curated_list = CuratedList.where(slug: @section.tag_id.gsub(%r{/}, "-")).first
refute_nil curated_list
- assert_equal [@artefact.id.to_s], curated_list.artefact_ids
+ assert_equal [@artefact.id], curated_list.artefact_ids
end
context "a curated_list already exists" do
@@ -129,7 +129,7 @@ def login_as_user_with_permission
put :update, id: @section.id, section: {}, curated_list: { artefact_ids: [@artefact.id] }
curated_list = CuratedList.where(slug: @section.tag_id.gsub(%r{/}, "-")).first
refute_nil curated_list
- assert_equal [@artefact.id.to_s], curated_list.artefact_ids
+ assert_equal [@artefact.id], curated_list.artefact_ids
end
end
end

0 comments on commit c09274d

Please sign in to comment.