diff --git a/spec/requests/calculators_spec.rb b/spec/requests/calculators_spec.rb index cedb98f34..4b5456a9f 100644 --- a/spec/requests/calculators_spec.rb +++ b/spec/requests/calculators_spec.rb @@ -174,14 +174,14 @@ end describe "POST #calculate" do - before do - sign_in user - end + context "when user sign_in" do + it "returns a successful response" do + sign_in user - it "returns a successful response" do - post calculate_calculator_path(calculator.slug) + post calculate_calculator_path(calculator.slug) - expect(response).to be_successful + expect(response).to be_successful + end end end end diff --git a/spec/requests/home_spec.rb b/spec/requests/home_spec.rb index ec810f105..2377116fd 100644 --- a/spec/requests/home_spec.rb +++ b/spec/requests/home_spec.rb @@ -24,7 +24,7 @@ context "redirect to root_url" do it "is successful" do - get "/" + get root_redirection_path expect(response).to redirect_to(root_path) end