left4me/rails/test/system/keys_test.rb
mwiegand 5ab99c7779
wip
2022-11-27 17:32:21 +01:00

47 lines
1 KiB
Ruby

require "application_system_test_case"
class KeysTest < ApplicationSystemTestCase
setup do
@key = keys(:one)
end
test "visiting the index" do
visit keys_url
assert_selector "h1", text: "Keys"
end
test "should create key" do
visit keys_url
click_on "New key"
fill_in "Ingame", with: @key.ingame
fill_in "Keycap", with: @key.keycap
fill_in "Short", with: @key.short
fill_in "Title", with: @key.title
click_on "Create Key"
assert_text "Key was successfully created"
click_on "Back"
end
test "should update Key" do
visit key_url(@key)
click_on "Edit this key", match: :first
fill_in "Ingame", with: @key.ingame
fill_in "Keycap", with: @key.keycap
fill_in "Short", with: @key.short
fill_in "Title", with: @key.title
click_on "Update Key"
assert_text "Key was successfully updated"
click_on "Back"
end
test "should destroy Key" do
visit key_url(@key)
click_on "Destroy this key", match: :first
assert_text "Key was successfully destroyed"
end
end