main
 1# frozen_string_literal: true
 2
 3require 'rails_helper'
 4
 5describe "when registering for an account", js: true do
 6  let(:email) { FFaker::Internet.email }
 7  let(:password) { FFaker::Internet.password }
 8
 9  specify do
10    visit new_registration_path
11    within "form[action^='/registrations']" do
12      fill_in "user_email", with: email
13      fill_in "user_password", with: password
14      fill_in "user_password_confirmation", with: password
15      click_button I18n.t('registrations.new.register')
16    end
17    within "form[action^='/session']" do
18      fill_in "user_email", with: email
19      fill_in "user_password", with: password
20      click_button I18n.t('sessions.new.login')
21    end
22    expect(page).to have_content(I18n.t('my.dashboards.show.title'))
23  end
24end