Skip to content

Commit

Permalink
Merge pull request #23 from alphagov/reducing_number_of_url_boxes
Browse files Browse the repository at this point in the history
Going from 3 to 1 URL box on the "content change request" form
  • Loading branch information
mnowster committed Dec 6, 2012
2 parents 386dd20 + d7b1b85 commit d55c9ce
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/models/content_change_request.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class ContentChangeRequest < TablelessModel
include WithTimeConstraint include WithTimeConstraint
include WithRequestContext include WithRequestContext


attr_accessor :details_of_change, :url1, :url2, :url3 attr_accessor :details_of_change, :url
validates_presence_of :details_of_change validates_presence_of :details_of_change
end end
6 changes: 2 additions & 4 deletions app/views/content_change_requests/_request_details.html.erb
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,6 @@
<%= render :partial => "support/request_context", :locals => {:f => f} %> <%= render :partial => "support/request_context", :locals => {:f => f} %>
<%= f.inputs :name => "URL(s) affected" do %> <%= f.inputs :name => "URL affected" do %>
<%= f.input :url1, :label => "URL 1", :input_html => {:class => "span6", :placeholder => "https://www.gov.uk/"} %> <%= f.input :url, :label => "URL", :input_html => {:class => "span6", :placeholder => "https://www.gov.uk/"} %>
<%= f.input :url2, :label => "URL 2", :input_html => {:class => "span6", :placeholder => "https://www.gov.uk/"} %>
<%= f.input :url3, :label => "URL 3", :input_html => {:class => "span6", :placeholder => "https://www.gov.uk/"} %>
<%= f.input :details_of_change, :as => :text, :label => "Details of the requested change", :required => :true, :input_html => {:class => "span6", :rows => 6, :cols => 50, :"aria-required" => true } %> <%= f.input :details_of_change, :as => :text, :label => "Details of the requested change", :required => :true, :input_html => {:class => "span6", :rows => 6, :cols => 50, :"aria-required" => true } %>
<% end %> <% end %>
7 changes: 3 additions & 4 deletions features/content_change_requests.feature
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Feature: Content change requests


Scenario: successful Mainstream content change request Scenario: successful Mainstream content change request
When the user submits the following content change request: When the user submits the following content change request:
| Context | Details of change | URL 1 | URL 2 | Needed by date | Not before date | Reason | | Context | Details of change | URL | Needed by date | Not before date | Reason |
| Mainstream (business/citizen) | Out of date XX YY | http://gov.uk/X | http://gov.uk/Y | 31-12-2020 | 01-12-2020 | New law | | Mainstream (business/citizen) | Out of date XX YY | http://gov.uk/X | 31-12-2020 | 01-12-2020 | New law |


Then the following ticket is raised in ZenDesk: Then the following ticket is raised in ZenDesk:
| Subject | Requester email | | Subject | Requester email |
Expand All @@ -25,9 +25,8 @@ Feature: Content change requests
[Which part of GOV.UK is this about?] [Which part of GOV.UK is this about?]
Mainstream (business/citizen) Mainstream (business/citizen)
[URl(s) of content to be changed] [URL of content to be changed]
http://gov.uk/X http://gov.uk/X
http://gov.uk/Y
[Details of what should be added, amended or removed] [Details of what should be added, amended or removed]
Out of date XX YY Out of date XX YY
Expand Down
4 changes: 1 addition & 3 deletions features/step_definitions/request_steps.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@
end end


fill_in "Details of the requested change", :with => @request_details["Details of change"] fill_in "Details of the requested change", :with => @request_details["Details of change"]
fill_in "URL 1", :with => @request_details["URL 1"] fill_in "URL", :with => @request_details["URL"]
fill_in "URL 2", :with => @request_details["URL 2"]
fill_in "URL 3", :with => @request_details["URL 3"]


step "the user fills out the time constraints" step "the user fills out the time constraints"
step "the user submits the request successfully" step "the user submits the request successfully"
Expand Down
4 changes: 2 additions & 2 deletions lib/content_change_request_zendesk_ticket.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def comment_snippets
[ [
CommentSnippet.new(on: @request, field: :formatted_request_context, CommentSnippet.new(on: @request, field: :formatted_request_context,
label: "Which part of GOV.UK is this about?"), label: "Which part of GOV.UK is this about?"),
CommentSnippet.new(on: @request, fields: [:url1, :url2, :url3], CommentSnippet.new(on: @request, field: :url,
label: "URl(s) of content to be changed"), label: "URL of content to be changed"),
CommentSnippet.new(on: @request, field: :details_of_change, CommentSnippet.new(on: @request, field: :details_of_change,
label: "Details of what should be added, amended or removed"), label: "Details of what should be added, amended or removed"),
CommentSnippet.new(on: @request.time_constraint, field: :time_constraint_reason) CommentSnippet.new(on: @request.time_constraint, field: :time_constraint_reason)
Expand Down
4 changes: 1 addition & 3 deletions test/unit/models/content_change_request_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ class ContentChangeRequestTest < Test::Unit::TestCase


should validate_presence_of(:request_context) should validate_presence_of(:request_context)


should allow_value("https://www.gov.uk").for(:url1) should allow_value("https://www.gov.uk").for(:url)
should allow_value("https://www.gov.uk").for(:url2)
should allow_value("https://www.gov.uk").for(:url3)


should "allow time constraints" do should "allow time constraints" do
request = ContentChangeRequest.new(:time_constraint => stub("time constraint", :valid? => true)) request = ContentChangeRequest.new(:time_constraint => stub("time constraint", :valid? => true))
Expand Down

0 comments on commit d55c9ce

Please sign in to comment.