Add support for specialist document attachments #133

Merged
merged 6 commits into from Mar 7, 2014

Conversation

Projects
None yet
4 participants
Contributor

heathd commented Mar 6, 2014

Specialist documents can have multiple attachments with titles. We capture the original filename so that we can present markdown hints for embedding the attachment in the admin UI.

heathd and others added some commits Mar 6, 2014

@heathd @bestie heathd Add support for specialist document attachments
Specialist documents can have multiple attachments with titles. We capture the original filename so that we can present markdown hints for embedding the attachment in the admin UI.
4c2f709
@bestie bestie Tidy up safe_html_validator_test
it's cleaner to use `#select` than mapping to possibly nil values and then compacting.

Also allow SafeHtml validator to be used on model classes which don't define GOVSPEAK_FIELDS, as it seems superfluous to define this on a model which doesn't have any fields.
e081a52
@bestie bestie Validate Attachments with SafeHtml validator 3c6afaa
@bestie bestie Attachments must expose URL 3470c82

@bradwright bradwright commented on an outdated diff Mar 7, 2014

test/models/attachment_test.rb
@@ -0,0 +1,40 @@
+require "test_helper"
+require "ostruct"
+require 'gds_api/test_helpers/asset_manager'
+
+class AttachmentTest < ActiveSupport::TestCase
+ include GdsApi::TestHelpers::AssetManager
+
+ setup do
+ Attachable.
@bradwright

bradwright Mar 7, 2014

Contributor

Syntax error.

heathd closed this Mar 7, 2014

@heathd heathd Stub asset_api_client rather than using webmock
Also tightened up the tests on specialist_document_edition to validate
that the file upload does get triggered when saving the
SpecialistDocumentEdition (verifying that the callbacks get fired on the
embedded attachment document).
65cacfe

heathd reopened this Mar 7, 2014

Contributor

heathd commented Mar 7, 2014

fixed those test failures, thanks Brad

alext merged commit 112ad52 into master Mar 7, 2014

1 check passed

default "Build #28 succeeded on Jenkins"
Details

alext deleted the add-attachments-to-specialist-document-edition branch Mar 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment