|
|
@ -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 |
|
|
|