Permalink
Browse files

Merge pull request #108 from alphagov/allow-service-feedback-without-…

…comment

service feedback: allow details to be blank
  • Loading branch information...
2 parents 455bdea + 524b7b7 commit 0dee2b6edf1ed36bd9f7019df96e95eaaa8def4b @Shotclog Shotclog committed Nov 19, 2013
@@ -52,9 +52,16 @@ Feature: Anonymous feedback
false
"""
- Scenario: successful service feedback submission
+ Scenario: successful service feedback submission with comment
When the user submits feedback about a GOV.UK service through the API:
| Slug | Satisfaction rating | Improvement comments | User agent | JS? |
| done/find-court-tribunal | 3 | Make service less 'meh' | Safari | yes |
# Then TBD...
# for now, we store the feedback and expose it later through an API
+
+ Scenario: successful service feedback submission without comment
+ When the user submits feedback about a GOV.UK service through the API:
+ | Slug | Satisfaction rating | Improvement comments | User agent | JS? |
+ | done/find-court-tribunal | 3 | | Safari | yes |
+ # Then TBD...
+ # for now, we store the feedback and expose it later through an API
@@ -6,7 +6,7 @@ module Anonymous
class ServiceFeedback < AnonymousContact
attr_accessible :details, :slug, :service_satisfaction_rating
- validates_presence_of :details, :slug, :service_satisfaction_rating
+ validates_presence_of :slug, :service_satisfaction_rating
validates :details, length: { maximum: 2 ** 16 }
validates_inclusion_of :service_satisfaction_rating, in: (1..5).to_a
end
@@ -6,7 +6,7 @@ module Requests
module Anonymous
class ServiceFeedbackTest < Test::Unit::TestCase
should validate_presence_of(:service_satisfaction_rating)
- should validate_presence_of(:details)
+ should allow_value(nil).for(:details)
should validate_presence_of(:slug)
should ensure_inclusion_of(:service_satisfaction_rating).in_range(1..5)

0 comments on commit 0dee2b6

Please sign in to comment.