forked from fixin.me/fixin.me
Prepare system testing
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
require "test_helper"
|
||||
|
||||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
|
||||
# NOTE: remove when capabilities no longer used by Rails
|
||||
Selenium::WebDriver.logger.ignore(:capabilities)
|
||||
|
||||
driven_by :selenium, using: :headless_firefox, screen_size: [1600, 900]
|
||||
end
|
||||
|
||||
12
test/fixtures/users.yml
vendored
12
test/fixtures/users.yml
vendored
@@ -1,9 +1,3 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
email: MyString
|
||||
status: 1
|
||||
|
||||
two:
|
||||
email: MyString
|
||||
status: 1
|
||||
admin:
|
||||
email: admin@dev27.fixin.me
|
||||
status: admin
|
||||
|
||||
@@ -2,42 +2,27 @@ require "application_system_test_case"
|
||||
|
||||
class UsersTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@user = users(:one)
|
||||
@admin = users(:admin)
|
||||
end
|
||||
|
||||
test "visiting the index" do
|
||||
visit users_url
|
||||
assert_selector "h1", text: "Users"
|
||||
test "sign in" do
|
||||
visit new_user_session_url
|
||||
end
|
||||
|
||||
test "should create user" do
|
||||
visit users_url
|
||||
click_on "New user"
|
||||
#test "visiting the index" do
|
||||
# visit users_url
|
||||
# assert_selector "h1", text: "Users"
|
||||
#end
|
||||
|
||||
fill_in "Email", with: @user.email
|
||||
fill_in "Status", with: @user.status
|
||||
click_on "Create User"
|
||||
#test "should create user" do
|
||||
# visit users_url
|
||||
# click_on "New user"
|
||||
|
||||
assert_text "User was successfully created"
|
||||
click_on "Back"
|
||||
end
|
||||
# fill_in "Email", with: @user.email
|
||||
# fill_in "Status", with: @user.status
|
||||
# click_on "Create User"
|
||||
|
||||
test "should update User" do
|
||||
visit user_url(@user)
|
||||
click_on "Edit this user", match: :first
|
||||
|
||||
fill_in "Email", with: @user.email
|
||||
fill_in "Status", with: @user.status
|
||||
click_on "Update User"
|
||||
|
||||
assert_text "User was successfully updated"
|
||||
click_on "Back"
|
||||
end
|
||||
|
||||
test "should destroy User" do
|
||||
visit user_url(@user)
|
||||
click_on "Destroy this user", match: :first
|
||||
|
||||
assert_text "User was successfully destroyed"
|
||||
end
|
||||
# assert_text "User was successfully created"
|
||||
# click_on "Back"
|
||||
#end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user