docbrown/spec/requests/registrations_spec.rb
rhymes 8407bf9b4e
[deploy] Authentication refactoring: cleanups (#7576)
* Use Devise registry to list available providers

* Cleanups following Devise+Omniauth docs

* More cleanups

* Use helpers

* More cleanups

* Oops, forgot to remove these specs
2020-04-29 10:33:30 -04:00

23 lines
502 B
Ruby

require "rails_helper"
RSpec.describe "Registrations", type: :request do
let(:user) { create(:user) }
describe "GET /enter" do
context "when not logged in" do
it "shows the sign in page" do
get "/enter"
expect(response.body).to include "Great to have you"
end
end
context "when logged in" do
it "redirects to /dashboard" do
sign_in user
get "/enter"
expect(response).to redirect_to("/dashboard")
end
end
end
end