docbrown/spec/requests/registration_spec.rb
rhymes a0c9576bec Export comments (#1471)
* Use name attribute

* Export comments

* Update copy

* Fix time-dependent test

* Remove reactions_count from the export

* Only select needed attributes from the DB

* Add the path of the commentable to the export

Comments are attached to something but from the export that is not easily identifiable. We add the "commentable_path" to give some context.
2019-01-16 12:54:45 -05:00

25 lines
600 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
login_as 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