Skip to content

Commit fa13a9c

Browse files
DrewProebstelDrew Proebstel
andauthored
Fyst 2082 redirect all existing ty 24 fyst ur ls to fileyourstatetaxes org (#6104)
* wip fyst redirect * creates redirect concern * fix NJ test * change orders of concerns * remove redirect login with flipper flag * maybe we didnt need to do that --------- Co-authored-by: Drew Proebstel <[email protected]>
1 parent 64337fc commit fa13a9c

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module StateFile
2+
module FystSunsetRedirectConcern
3+
extend ActiveSupport::Concern
4+
5+
included do
6+
before_action :sunset_redirect_to_homepage
7+
end
8+
9+
private
10+
11+
def sunset_redirect_to_homepage
12+
if Flipper.enabled?(:fyst_sunset_pya_live)
13+
redirect_to root_path
14+
end
15+
end
16+
end
17+
end

app/controllers/state_file/landing_page_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module StateFile
22
class LandingPageController < ApplicationController
33
include StateFile::StateFileControllerConcern
4+
include StateFile::FystSunsetRedirectConcern
45
layout "state_file"
56

67
def edit

app/controllers/state_file/questions/questions_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module StateFile
22
module Questions
33
class QuestionsController < ::Questions::QuestionsController
4+
include StateFile::FystSunsetRedirectConcern
45
include StateFile::StateFileIntakeConcern
56
before_action :redirect_if_no_intake, :redirect_if_in_progress_intakes_ended, :redirect_if_df_data_required
67

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
require "rails_helper"
2+
3+
RSpec.describe "StateFile::FystSunsetRedirectConcern", type: :controller do
4+
controller(ApplicationController) do
5+
include StateFile::FystSunsetRedirectConcern
6+
7+
def index
8+
render plain: "ok"
9+
end
10+
end
11+
12+
before do
13+
allow(controller).to receive(:root_path).and_return("/")
14+
15+
routes.draw do
16+
get "anonymous/index" => "anonymous#index"
17+
end
18+
end
19+
20+
context "when the feature flag is enabled" do
21+
before do
22+
allow(Flipper).to receive(:enabled?).with(:fyst_sunset_pya_live).and_return(true)
23+
end
24+
25+
it "redirects to root_path" do
26+
get :index
27+
expect(response).to redirect_to("/")
28+
end
29+
end
30+
31+
context "when the feature flag is disabled" do
32+
before do
33+
allow(Flipper).to receive(:enabled?).with(:fyst_sunset_pya_live).and_return(false)
34+
end
35+
36+
it "does not redirect" do
37+
get :index
38+
expect(response).to have_http_status(:ok)
39+
expect(response.body).to eq("ok")
40+
end
41+
end
42+
end

spec/controllers/state_file/questions/nj_estimated_tax_payments_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
let(:intake) { create :state_file_nj_intake }
55
before do
66
sign_in intake
7+
8+
allow(Flipper).to receive(:enabled?).and_return(false)
79
end
810

911
describe "#edit" do

0 commit comments

Comments
 (0)