# frozen_string_literal: true

require 'rails_helper'

feature '<%= human_name %> signs up' do

scenario 'with valid data' do
  visit new_<%= singular_name %>_registration_path

  fill_in 'Email', with: 'username@example.com'
  fill_in 'Password', with: 'password'
  fill_in 'Password confirmation', with: 'password'
  click_button 'Create Account'

  expect(page).to have_text 'Welcome! You have signed up successfully.'
  expect(page).to have_link 'Sign out'
  expect(page).to have_current_path authenticated_root_path
end

scenario 'with invalid data' do
  visit new_<%= singular_name %>_registration_path

  click_button 'Create Account'

  expect(page).to have_text "Email can't be blank"
  expect(page).to have_text "Password can't be blank"
  expect(page).to have_no_link 'Sign out'
end

end