mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
Add users factory for tests
This commit is contained in:
@@ -6,6 +6,9 @@
|
|||||||
Rails.application.configure do
|
Rails.application.configure do
|
||||||
# Settings specified here will take precedence over those in config/application.rb.
|
# Settings specified here will take precedence over those in config/application.rb.
|
||||||
|
|
||||||
|
# For Devise
|
||||||
|
config.action_mailer.default_url_options = { host: 'localhost:3000' }
|
||||||
|
|
||||||
config.cache_classes = false
|
config.cache_classes = false
|
||||||
|
|
||||||
# Do not eager load code on boot. This avoids loading your whole application
|
# Do not eager load code on boot. This avoids loading your whole application
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
FactoryBot.define do
|
FactoryBot.define do
|
||||||
factory :user do
|
factory :user do
|
||||||
|
sequence(:email) { |n| "user#{n}@example.com" }
|
||||||
|
|
||||||
|
full_name { "First Last" }
|
||||||
|
password { "password" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
20
spec/system/session_spec.rb
Normal file
20
spec/system/session_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe "Session", type: :system do
|
||||||
|
|
||||||
|
# def log_in_as(user)
|
||||||
|
# visit new_user_session_path
|
||||||
|
# fill_in "Email", with: "user0@example.com"
|
||||||
|
# fill_in "Password", with: "password"
|
||||||
|
# click_button "Log in"
|
||||||
|
# end
|
||||||
|
|
||||||
|
# let(:user) { FactoryBot.create(:user) }
|
||||||
|
|
||||||
|
# it 'allows a logged-in user to view profile settings' do
|
||||||
|
# log_in_as user
|
||||||
|
# visit edit_user_registration_path
|
||||||
|
# expect(current_path).to eq(edit_user_registration_path)
|
||||||
|
# end
|
||||||
|
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user