|
|
|
@ -710,6 +710,41 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when updating secondary client group" do |
|
|
|
|
let(:params) { { scheme: { secondary_client_group: "Homeless families with support needs", page: "secondary-client-group" } } } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
sign_in user |
|
|
|
|
patch "/schemes/#{scheme_to_update.id}", params: |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "renders confirm secondary group after successful update" do |
|
|
|
|
follow_redirect! |
|
|
|
|
expect(response).to have_http_status(:ok) |
|
|
|
|
expect(page).to have_content("What support does this scheme provide?") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "updates a scheme with valid params" do |
|
|
|
|
follow_redirect! |
|
|
|
|
expect(scheme_to_update.reload.secondary_client_group).to eq("Homeless families with support needs") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when updating from check answers page" do |
|
|
|
|
let(:params) { { scheme: { secondary_client_group: "Homeless families with support needs", page: "secondary-client-group", check_answers: "true" } } } |
|
|
|
|
|
|
|
|
|
it "renders check answers page after successful update" do |
|
|
|
|
follow_redirect! |
|
|
|
|
expect(response).to have_http_status(:ok) |
|
|
|
|
expect(page).to have_content("Check your changes before updating this scheme") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "updates a scheme with valid params" do |
|
|
|
|
follow_redirect! |
|
|
|
|
expect(scheme_to_update.reload.secondary_client_group).to eq("Homeless families with support needs") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|