Sha256: ac656cd17bc164dcb3991ade49f509257ad4215a20dd860eb0e472bbd49659c1

Contents?: true

Size: 1.5 KB

Versions: 2

Compression:

Stored size: 1.5 KB

Contents

# frozen_string_literal: true

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require File.expand_path('../acceptance_helper.rb', __dir__)

feature 'Users tab', '
  In order to increase customer satisfaction
  As an administrator
  I want to manage users
' do
  before(:each) do
    do_login(first_name: 'Captain', last_name: 'Kirk', admin: true)
  end

  scenario 'should create a new user', js: true do
    create(:group, name: "Superheroes")
    visit admin_users_path
    click_link 'Create User'
    expect(page).to have_selector('#user_username', visible: true)
    fill_in 'user_username', with: 'captainthunder'
    fill_in 'user_email', with: 'lightning@example.com'
    fill_in 'user_first_name', with: 'Captain'
    fill_in 'user_last_name', with: 'Thunder'
    fill_in 'user_password', with: 'password'
    fill_in 'user_password_confirmation', with: 'password'
    fill_in 'user_title', with: 'Chief'
    fill_in 'user_company', with: 'Weather Inc.'
    select2 'Superheroes', from: 'Groups:'

    click_button 'Create User'
    expect(find('#users')).to have_content('Captain Thunder')
    expect(find('#users')).to have_content('Weather Inc.')
    expect(find('#users')).to have_content('Superheroes')
    expect(find('#users')).to have_content('lightning@example.com')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fat_free_crm-0.20.1 spec/features/admin/users_spec.rb
fat_free_crm-0.20.0 spec/features/admin/users_spec.rb