Skip to content

Commit

Permalink
removed logged in tests because the route ignores authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
FireLemons committed Mar 27, 2023
1 parent b46c265 commit 5410223
Showing 1 changed file with 4 additions and 44 deletions.
48 changes: 4 additions & 44 deletions spec/requests/error_spec.rb
Original file line number Diff line number Diff line change
@@ -1,49 +1,9 @@
require "rails_helper"

RSpec.describe "/error", type: :request do
let(:organization) { create(:casa_org) }
let!(:admin) { create(:casa_admin, casa_org: organization) }
let!(:volunteer) { create(:volunteer, casa_org: organization) }
let!(:supervisor) { create(:supervisor, casa_org: organization) }

describe "GET /error" do
context "when logged in as admin user" do
it "raises an error causing an internal server error" do
sign_in admin

expect {
get error_path
}.to raise_error(StandardError, /This is an intentional test exception/)
end
end

context "when logged in as volunteer" do
it "raises an error causing an internal server error" do
sign_in volunteer

expect {
get error_path
}.to raise_error(StandardError, /This is an intentional test exception/)
end
end

context "when logged in as supervisor" do
it "raises an error causing an internal server error" do
sign_in supervisor

expect {
get error_path
}.to raise_error(StandardError, /This is an intentional test exception/)
end
end

context "when not logged in" do
it "raises an error causing an internal server error" do

expect {
get error_path
}.to raise_error(StandardError, /This is an intentional test exception/)
end
end
it "raises an error causing an internal server error" do
expect {
get error_path
}.to raise_error(StandardError, /This is an intentional test exception/)
end
end

0 comments on commit 5410223

Please sign in to comment.