Sha256: 0902374b99844b0052cb7eb2ee282173eb0d137bf711cce031197df09ef4cc63

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require "application_system_test_case"

class Admin::UsersTest < ApplicationSystemTestCase
  setup do
    @admin_user = sign_in_admin_as(admin_users(:lazaro_nixon))
  end

  test "visiting the index" do
    visit admin_users_url
    assert_selector "h2", text: "Users"
  end

  test "should create user" do
    visit admin_users_url
    click_on "New user"

    fill_in "Email", with: "lazaronixon@hey.com"
    fill_in "Password", with: "Secret1*3*5*"
    fill_in "Password confirmation", with: "Secret1*3*5*"
    click_on "Create User"

    assert_text "User was successfully created"
  end

  test "should update user" do
    visit admin_user_url(@admin_user)
    click_on "Edit user"

    fill_in "Email", with: @admin_user.email
    fill_in "Password", with: "NewSecret1*3*5*"
    fill_in "Password confirmation", with: "NewSecret1*3*5*"
    click_on "Update User"

    assert_text "User was successfully updated"
  end

  test "should destroy user" do
    visit admin_user_url(@admin_user)
    page.accept_confirm { click_on "Delete user" }

    assert_text "User was successfully destroyed"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
administration-zero-0.0.13 lib/generators/admin/install/templates/test_unit/system/admin/users_test.rb
administration-zero-0.0.12 lib/generators/admin/install/templates/test_unit/system/admin/users_test.rb
administration-zero-0.0.11 lib/generators/admin/install/templates/test_unit/system/admin/users_test.rb