Browse Source

checking the back functionality

pull/671/head
JG 3 years ago
parent
commit
9e7197bbbb
  1. 19
      spec/features/schemes_spec.rb

19
spec/features/schemes_spec.rb

@ -247,6 +247,8 @@ RSpec.describe "Schemes scheme Features" do
end end
context "when I fill in scheme details and I press save I see primary client group section" do context "when I fill in scheme details and I press save I see primary client group section" do
let(:scheme) { Scheme.first }
before do before do
fill_in "Scheme name", with: "FooBar" fill_in "Scheme name", with: "FooBar"
check "This scheme contains confidential information" check "This scheme contains confidential information"
@ -261,6 +263,22 @@ RSpec.describe "Schemes scheme Features" do
expect(page).to have_content "What client group is this scheme intended for?" expect(page).to have_content "What client group is this scheme intended for?"
end end
context "when I press the back button" do
before do
click_link "Back"
end
it "lets me fill in the scheme details" do
expect(page).to have_current_path("/schemes/#{scheme.id}/details")
expect(page).to have_content "Scheme name"
expect(page).to have_content "This scheme contains confidential information"
expect(page).to have_content "Which organisation manages this scheme"
expect(page).to have_content "What is this type of scheme?"
expect(page).to have_content "Is this scheme registered under the Care Standards Act 2000?"
expect(page).to have_content "Total number of units"
end
end
context "when I select primary client group details" do context "when I select primary client group details" do
before do before do
choose "Homeless families with support needs" choose "Homeless families with support needs"
@ -303,7 +321,6 @@ RSpec.describe "Schemes scheme Features" do
end end
context "when changing answers" do context "when changing answers" do
let!(:scheme) { Scheme.first }
it "displays change links" do it "displays change links" do
assert_selector "a", text: "Change", count: 12 assert_selector "a", text: "Change", count: 12

Loading…
Cancel
Save