Browse Source

testing patch for schemes

pull/671/head
JG 3 years ago
parent
commit
977ddd6688
  1. 2
      config/locales/en.yml
  2. 23
      spec/requests/schemes_controller_spec.rb

2
config/locales/en.yml

@ -44,7 +44,7 @@ en:
scheme: scheme:
attributes: attributes:
organisation: organisation:
required: "Enter the organisation’s name" required: "Enter the existing organisation’s name"
validations: validations:
organisation: organisation:

23
spec/requests/schemes_controller_spec.rb

@ -599,4 +599,27 @@ RSpec.describe SchemesController, type: :request do
end end
end end
end end
describe "#update" do
context "when not signed in" do
it "redirects to the sign in page" do
patch "/schemes"
expect(response).to redirect_to("/account/sign-in")
end
end
context "when signed in as a data provider" do
let(:user) { FactoryBot.create(:user) }
before do
sign_in user
patch "/schemes"
end
it "returns 401 unauthorized" do
request
expect(response).to have_http_status(:unauthorized)
end
end
end
end end

Loading…
Cancel
Save