* Change all login_as to sign_in * Unskip comment spec * Create new specs * Turn on Webdriver caching * Set logger for Omniauth in test * Update editor system spec * Fix editor approval file * Update video_controller * Update TagAdjustmentUpdateService's spec * Update users api spec * Update stories_index_spec * Remove redundant spec file * Remove residual code * Change ClassifiedListing spec * Update NotificationsIndex spec
25 lines
599 B
Ruby
25 lines
599 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
|
|
|
|
Timecop.freeze(Time.current) do
|
|
get "/enter"
|
|
expect(response).to redirect_to("/dashboard?signed-in-already&t=#{Time.current.to_i}")
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|