Browse Source

flashing test rubocop

pull/671/head
JG 3 years ago
parent
commit
8f0be6d632
  1. 2
      app/controllers/schemes_controller.rb
  2. 4
      spec/requests/schemes_controller_spec.rb

2
app/controllers/schemes_controller.rb

@ -7,7 +7,7 @@ class SchemesController < ApplicationController
before_action :authenticate_scope! before_action :authenticate_scope!
def index def index
flash[:notice] = ("#{Scheme.find(params[:scheme_id].to_i).service_name} has been created.") if params[:scheme_id] flash[:notice] = "#{Scheme.find(params[:scheme_id].to_i).service_name} has been created." if params[:scheme_id]
redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support? redirect_to schemes_organisation_path(current_user.organisation) unless current_user.support?
all_schemes = Scheme.all all_schemes = Scheme.all

4
spec/requests/schemes_controller_spec.rb

@ -37,7 +37,7 @@ RSpec.describe SchemesController, type: :request do
get "/schemes" get "/schemes"
end end
context "params scheme_id is present" do context "when params scheme_id is present" do
it "shows a success banner" do it "shows a success banner" do
get "/schemes", params: { scheme_id: schemes.first.id } get "/schemes", params: { scheme_id: schemes.first.id }
follow_redirect! follow_redirect!
@ -85,7 +85,7 @@ RSpec.describe SchemesController, type: :request do
expect(CGI.unescape_html(response.body)).to include(expected_field) expect(CGI.unescape_html(response.body)).to include(expected_field)
end end
context "params scheme_id is present" do context "when params scheme_id is present" do
it "shows a success banner" do it "shows a success banner" do
get "/schemes", params: { scheme_id: schemes.first.id } get "/schemes", params: { scheme_id: schemes.first.id }
expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success") expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")

Loading…
Cancel
Save