Permalink
Browse files

Merge pull request #28 from alphagov/introduce_reason_for_removal_on_…

…remove_user_request

remove user request: "additional comments" => "reason for removal"
  • Loading branch information...
2 parents 34c5dda + 1f9c1c9 commit 7e635c7ea194ebb6fce872c1d4cda1f08db2f93d @jamiecobbett jamiecobbett committed Dec 12, 2012
@@ -8,7 +8,7 @@ class RemoveUserRequest < TablelessModel
include WithToolRoleChoice
include WithTimeConstraint
- attr_accessor :user_name, :user_email, :additional_comments
+ attr_accessor :user_name, :user_email, :reason_for_removal
validates_presence_of :user_name, :user_email
validates :user_email, :format => {:with => /@/}
end
@@ -10,6 +10,6 @@
<%= r.input :not_before_date, :label => "MUST NOT be removed BEFORE", :required => false, :input_html => {:"calendar-enabled" => true, :placeholder => "dd-mm-YYYY", :value => r.object.not_before_date} %>
<% end %>
- <%= f.input :additional_comments, :as => :text, :label => "Additional comments", :input_html => {:class => "span6", :rows => 6, :cols => 50 } %>
+ <%= f.input :reason_for_removal, :as => :text, :label => "Reason for removal", :input_html => {:class => "span6", :rows => 6, :cols => 50 } %>
<% end %>
</div>
@@ -10,8 +10,8 @@ Feature: Remove user requests
Scenario: successful remove user request for publisher
When the user submits the following remove user request:
- | Tool/Role | User's name | User's email | Not before date | Additional comments |
- | Departmental Contact Form | Bob Wasfired | bob@gov.uk | 31-12-2020 | XXXX |
+ | Tool/Role | User's name | User's email | Not before date | Reason for removal |
+ | Departmental Contact Form | Bob Wasfired | bob@gov.uk | 31-12-2020 | XXXX |
Then the following ticket is raised in ZenDesk:
| Subject | Requester email | Requester name | Phone | Job title |
| Remove user | john.smith@email.com | John Smith | 12345 | Developer |
@@ -30,6 +30,6 @@ Feature: Remove user requests
[User email]
bob@gov.uk
- [Additional comments]
+ [Reason for removal]
XXXX
"""
@@ -119,7 +119,7 @@
within("#user_details") do
fill_in "Name", :with => @request_details["User's name"]
fill_in "Email", :with => @request_details["User's email"]
- fill_in "Additional comments", :with => @request_details["Additional comments"]
+ fill_in "Reason for removal", :with => @request_details["Reason for removal"]
end
fill_in "MUST NOT be removed BEFORE", :with => @request_details["Not before date"]
@@ -17,7 +17,7 @@ def comment_snippets
label: "Tool/Role"),
CommentSnippet.new(on: @request, field: :user_name),
CommentSnippet.new(on: @request, field: :user_email),
- CommentSnippet.new(on: @request, field: :additional_comments)
+ CommentSnippet.new(on: @request, field: :reason_for_removal)
]
end
end
@@ -17,7 +17,7 @@ def as_str(date)
should allow_value("ab@c.com").for(:user_email)
should_not allow_value("ab").for(:user_email)
- should allow_value("a comment").for(:additional_comments)
+ should allow_value("was fired").for(:reason_for_removal)
should "allow time constraints" do
request = RemoveUserRequest.new(:time_constraint => stub("time constraint", :valid? => true))

0 comments on commit 7e635c7

Please sign in to comment.