Sha256: 4b1d093cf5620f4505d5f4ed5cb263c15fa1d7737234fb8f717edfdbb42a85c9

Contents?: true

Size: 963 Bytes

Versions: 40

Compression:

Stored size: 963 Bytes

Contents

require 'rails_helper'

describe "Admin user management workflow", type: :feature, js: true do
  include CapybaraCommon

  before :all do
    @admin = create :user
    login_as(@admin, :scope => :user)
  end

  it "should let me add a new editor in admin" do
    visit virgo.admin_users_path

    first(:css, '#new-user-link').click

    fill_in_user_details
  end

  private

  def fill_in_user_details
    fill_in 'user_username', with: "user_#{Time.now.to_i}"
    fill_in 'user_first_name', with: Faker::Name.first_name
    fill_in 'user_last_name', with: Faker::Name.last_name
    fill_in 'user_byline', with: "Byline #{Time.now.to_i}"
    select 'Editor', from: 'user_role'
    fill_in 'user_email', with: "email#{Time.now.to_i}@example.com"
    fill_in 'user_password', with: 'password'
    fill_in 'user_password_confirmation', with: 'password'
    first(:css, '#save-user').click
    expect(page).to have_content('Account created successfully')
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
virgo-0.3.17 spec/features/admin/user_management_spec.rb
virgo-0.3.16 spec/features/admin/user_management_spec.rb
virgo-0.3.15 spec/features/admin/user_management_spec.rb
virgo-0.3.14 spec/features/admin/user_management_spec.rb
virgo-0.3.13 spec/features/admin/user_management_spec.rb
virgo-0.3.12 spec/features/admin/user_management_spec.rb
virgo-0.3.11 spec/features/admin/user_management_spec.rb
virgo-0.3.10 spec/features/admin/user_management_spec.rb
virgo-0.3.9 spec/features/admin/user_management_spec.rb
virgo-0.3.8 spec/features/admin/user_management_spec.rb
virgo-0.3.7 spec/features/admin/user_management_spec.rb
virgo-0.3.6 spec/features/admin/user_management_spec.rb
virgo-0.3.4 spec/features/admin/user_management_spec.rb
virgo-0.3.3 spec/features/admin/user_management_spec.rb
virgo-0.3.2 spec/features/admin/user_management_spec.rb
virgo-0.3.1 spec/features/admin/user_management_spec.rb
virgo-0.3 spec/features/admin/user_management_spec.rb
virgo-0.2.9 spec/features/admin/user_management_spec.rb
virgo-0.2.8 spec/features/admin/user_management_spec.rb
virgo-0.2.7 spec/features/admin/user_management_spec.rb