46 lines
1017 B
Ruby
46 lines
1017 B
Ruby
require "application_system_test_case"
|
|
|
|
class CafsTest < ApplicationSystemTestCase
|
|
setup do
|
|
@caf = cafs(:one)
|
|
end
|
|
|
|
test "visiting the index" do
|
|
visit cafs_url
|
|
assert_selector "h1", text: "Cafs"
|
|
end
|
|
|
|
test "should create caf" do
|
|
visit cafs_url
|
|
click_on "New caf"
|
|
|
|
fill_in "Company", with: @caf.company_id
|
|
fill_in "Description", with: @caf.description
|
|
fill_in "Name", with: @caf.name
|
|
click_on "Create Caf"
|
|
|
|
assert_text "Caf was successfully created"
|
|
click_on "Back"
|
|
end
|
|
|
|
test "should update Caf" do
|
|
visit caf_url(@caf)
|
|
click_on "Edit this caf", match: :first
|
|
|
|
fill_in "Company", with: @caf.company_id
|
|
fill_in "Description", with: @caf.description
|
|
fill_in "Name", with: @caf.name
|
|
click_on "Update Caf"
|
|
|
|
assert_text "Caf was successfully updated"
|
|
click_on "Back"
|
|
end
|
|
|
|
test "should destroy Caf" do
|
|
visit caf_url(@caf)
|
|
click_on "Destroy this caf", match: :first
|
|
|
|
assert_text "Caf was successfully destroyed"
|
|
end
|
|
end
|