* Use timezone aware datetime methods * Use timezone aware date parse for GitHub issue tag * Introduce a bit of chaos programming using Zonebie Zonebie uses a random timezone to run tests, it's a really good way to see if the code is timezone dependent or not. * Convert GitHub issue date as UTC
22 lines
551 B
Ruby
22 lines
551 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 "Sign In or Create Your Account"
|
|
end
|
|
end
|
|
|
|
context "when logged in" do
|
|
it "redirects to /dashboard" do
|
|
login_as user
|
|
get "/enter"
|
|
is_expected.to redirect_to("/dashboard?signed-in-already&t=#{Time.current.to_i}")
|
|
end
|
|
end
|
|
end
|
|
end
|