Move redirection test to controller specs

We make the test faster and avoid a strange issue with `current_path` in
JavaScript tests.

We should probably have done this in commit ec1874325.
This commit is contained in:
Javi Martín
2021-03-27 20:19:30 +01:00
parent 81295abd8c
commit abd6a1971f
2 changed files with 11 additions and 10 deletions

View File

@@ -0,0 +1,11 @@
require "rails_helper"
describe Legislation::ProposalsController do
describe "GET new" do
it "redirects to register path if user is not logged in" do
get :new, params: { process_id: create(:legislation_process, :in_proposals_phase).id }
expect(response).to redirect_to new_user_session_path
end
end
end