Skip to content

Commit

Permalink
Test GET create_user
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiecobbett committed Oct 17, 2012
1 parent c692ba3 commit d8f8bca
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions test/functional/support_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative "../test_helper"

class SupportControllerTest < ActionController::TestCase
def stub_zendesk
def stub_zendesk_organisation_list
url = %r{https://.*@govuk.zendesk.com/api/v2/ticket_fields/21494928}
body = {
"ticket_field" => {
Expand Down Expand Up @@ -43,24 +43,23 @@ def stub_zendesk

context "GET amend_content" do
setup do
stub_zendesk
stub_zendesk_organisation_list
end

should "render the form" do
get :amend_content
assert_select "h1", /Content Change/i

end

should "using ZenDesk to populate the organisation dropdown" do
should "use ZenDesk to populate the organisation dropdown" do
get :amend_content
assert_select "select#organisation_list option", "Advocate General for Scotland"
end
end

context "POST amend_content" do
setup do
stub_zendesk
stub_zendesk_organisation_list
end

should "reject invalid change requests" do
Expand Down Expand Up @@ -113,4 +112,20 @@ def stub_zendesk
assert_redirected_to "/acknowledge"
end
end

context "GET create_user" do
setup do
stub_zendesk_organisation_list
end

should "render the form" do
get :create_user
assert_select "h1", /Create New User/i
end

should "use ZenDesk to populate the organisation dropdown" do
get :create_user
assert_select "select#organisation_list option", "Advocate General for Scotland"
end
end
end

0 comments on commit d8f8bca

Please sign in to comment.