-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1248 from alphagov/restore-support-form
Restore support form
- Loading branch information
Showing
3 changed files
with
237 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,106 @@ | ||
require "rails_helper" | ||
|
||
# RSpec.feature "Support tickets", type: :feature do | ||
# before do | ||
# visit support_path | ||
# end | ||
|
||
# feature "Reporting a problem" do | ||
# let(:ticket) { build :ticket, support: "feedback" } | ||
|
||
# scenario "Send a support ticket to Zendesk" do | ||
# choose "I want to report a problem" | ||
# click_on "Continue" | ||
# expect(page).to have_content "Report a problem" | ||
|
||
# fill_in "Your message", with: ticket.content | ||
# fill_in "Name", with: ticket.name | ||
# fill_in "Email address", with: ticket.email | ||
|
||
# expect(Zendesk.client) | ||
# .to receive_message_chain("tickets.create!") | ||
# .with(ticket.to_json) | ||
|
||
# click_on "Submit" | ||
# expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
# end | ||
# end | ||
|
||
# feature "Asking government to publish new data" do | ||
# let(:ticket) { build :ticket, support: "data" } | ||
|
||
# scenario "Send a support ticket to Zendesk" do | ||
# choose "I want government to publish new data" | ||
# click_on "Continue" | ||
# expect(page).to have_content "Ask the government to publish new data" | ||
|
||
# fill_in "Your message", with: ticket.content | ||
# fill_in "Name", with: ticket.name | ||
# fill_in "Email address", with: ticket.email | ||
|
||
# expect(Zendesk.client) | ||
# .to receive_message_chain("tickets.create!") | ||
# .with(ticket.to_json) | ||
|
||
# click_on "Submit" | ||
# expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
# end | ||
# end | ||
|
||
# feature "Becoming a publisher" do | ||
# let(:ticket) { build :ticket, support: "publish" } | ||
|
||
# scenario "Send a support ticket to Zendesk" do | ||
# choose "I want to publish for an organisation" | ||
# click_on "Continue" | ||
# expect(page).to have_content "Publish for an organisation" | ||
|
||
# fill_in "Your message", with: ticket.content | ||
# fill_in "Name", with: ticket.name | ||
# fill_in "Email address", with: ticket.email | ||
|
||
# expect(Zendesk.client) | ||
# .to receive_message_chain("tickets.create!") | ||
# .with(ticket.to_json) | ||
|
||
# click_on "Submit" | ||
# expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
# end | ||
# end | ||
|
||
# feature "Recover from invalid data" do | ||
# let(:ticket) { build :ticket, email: "foo" } | ||
|
||
# scenario "Show the errors in the ticket form" do | ||
# choose "I want government to publish new data" | ||
# click_on "Continue" | ||
# fill_in "Email address", with: ticket.email | ||
|
||
# click_on "Submit" | ||
# expect(page).to have_content "Enter a valid email address" | ||
# expect(page).to have_content "Enter a name" | ||
# expect(page).to have_content "Enter a message" | ||
# end | ||
# end | ||
|
||
# feature "Reporting an accessibility issue" do | ||
# let(:ticket) { build :ticket, support: "accessibility" } | ||
|
||
# scenario "Send a support ticket to Zendesk" do | ||
# choose "I want to report an accessibility issue" | ||
# click_on "Continue" | ||
# expect(page).to have_content "Report an accessibility issue" | ||
|
||
# fill_in "Your message", with: ticket.content | ||
# fill_in "Name", with: ticket.name | ||
# fill_in "Email address", with: ticket.email | ||
|
||
# expect(Zendesk.client) | ||
# .to receive_message_chain("tickets.create!") | ||
# .with(ticket.to_json) | ||
|
||
# click_on "Submit" | ||
# expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
# end | ||
# end | ||
# end | ||
RSpec.feature "Support tickets", type: :feature do | ||
before do | ||
visit support_path | ||
end | ||
|
||
feature "Reporting a problem" do | ||
let(:ticket) { build :ticket, support: "feedback" } | ||
|
||
scenario "Send a support ticket to Zendesk" do | ||
choose "I want to report a problem" | ||
click_on "Continue" | ||
expect(page).to have_content "Report a problem" | ||
|
||
fill_in "Your message", with: ticket.content | ||
fill_in "Name", with: ticket.name | ||
fill_in "Email address", with: ticket.email | ||
|
||
expect(Zendesk.client) | ||
.to receive_message_chain("tickets.create!") | ||
.with(ticket.to_json) | ||
|
||
click_on "Submit" | ||
expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
end | ||
end | ||
|
||
feature "Asking government to publish new data" do | ||
let(:ticket) { build :ticket, support: "data" } | ||
|
||
scenario "Send a support ticket to Zendesk" do | ||
choose "I want government to publish new data" | ||
click_on "Continue" | ||
expect(page).to have_content "Ask the government to publish new data" | ||
|
||
fill_in "Your message", with: ticket.content | ||
fill_in "Name", with: ticket.name | ||
fill_in "Email address", with: ticket.email | ||
|
||
expect(Zendesk.client) | ||
.to receive_message_chain("tickets.create!") | ||
.with(ticket.to_json) | ||
|
||
click_on "Submit" | ||
expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
end | ||
end | ||
|
||
feature "Becoming a publisher" do | ||
let(:ticket) { build :ticket, support: "publish" } | ||
|
||
scenario "Send a support ticket to Zendesk" do | ||
choose "I want to publish for an organisation" | ||
click_on "Continue" | ||
expect(page).to have_content "Publish for an organisation" | ||
|
||
fill_in "Your message", with: ticket.content | ||
fill_in "Name", with: ticket.name | ||
fill_in "Email address", with: ticket.email | ||
|
||
expect(Zendesk.client) | ||
.to receive_message_chain("tickets.create!") | ||
.with(ticket.to_json) | ||
|
||
click_on "Submit" | ||
expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
end | ||
end | ||
|
||
feature "Recover from invalid data" do | ||
let(:ticket) { build :ticket, email: "foo" } | ||
|
||
scenario "Show the errors in the ticket form" do | ||
choose "I want government to publish new data" | ||
click_on "Continue" | ||
fill_in "Email address", with: ticket.email | ||
|
||
click_on "Submit" | ||
expect(page).to have_content "Enter a valid email address" | ||
expect(page).to have_content "Enter a name" | ||
expect(page).to have_content "Enter a message" | ||
end | ||
end | ||
|
||
feature "Reporting an accessibility issue" do | ||
let(:ticket) { build :ticket, support: "accessibility" } | ||
|
||
scenario "Send a support ticket to Zendesk" do | ||
choose "I want to report an accessibility issue" | ||
click_on "Continue" | ||
expect(page).to have_content "Report an accessibility issue" | ||
|
||
fill_in "Your message", with: ticket.content | ||
fill_in "Name", with: ticket.name | ||
fill_in "Email address", with: ticket.email | ||
|
||
expect(Zendesk.client) | ||
.to receive_message_chain("tickets.create!") | ||
.with(ticket.to_json) | ||
|
||
click_on "Submit" | ||
expect(page).to have_content "Thanks for contacting data.gov.uk" | ||
end | ||
end | ||
end |