Don't test XHR scenario as we don't have one anymore

private-asciicasts
Marcin Kulik 9 years ago
parent e05fbd574f
commit dbc18f9ce6

@ -41,17 +41,6 @@ describe FakesController do
end end
describe "action raise unauthorized" do describe "action raise unauthorized" do
context "when xhr" do
before { allow(request).to receive(:xhr?).and_return(true) }
it "responds with 401" do
get :foo
expect(response.status).to eq(401)
end
end
context "when normal request" do
it "redirects to login page" do it "redirects to login page" do
expect(@controller).to receive(:store_location) expect(@controller).to receive(:store_location)
@ -61,20 +50,8 @@ describe FakesController do
should redirect_to(new_login_path) should redirect_to(new_login_path)
end end
end end
end
context "when action raises Pundit::NotAuthorizedError" do context "when action raises Pundit::NotAuthorizedError" do
context "when xhr" do
before { allow(request).to receive(:xhr?).and_return(true) }
it "responds with 403" do
get :bar
expect(response.status).to eq(403)
end
end
context "when normal request" do
it "redirects to root_path" do it "redirects to root_path" do
get :bar get :bar
@ -82,7 +59,6 @@ describe FakesController do
should redirect_to(root_path) should redirect_to(root_path)
end end
end end
end
describe '#store_location / #get_stored_location' do describe '#store_location / #get_stored_location' do
it 'stores current request path to be later retrieved' do it 'stores current request path to be later retrieved' do

Loading…
Cancel
Save