very basic system tests
This commit is contained in:
parent
345a932514
commit
c31d4266cd
12 changed files with 114 additions and 185 deletions
|
|
@ -1,47 +1,37 @@
|
|||
require "application_system_test_case"
|
||||
require 'application_system_test_case'
|
||||
|
||||
class ElementsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@element = elements(:one)
|
||||
end
|
||||
|
||||
test "visiting the index" do
|
||||
test 'visiting the index' do
|
||||
visit elements_url
|
||||
assert_selector "h1", text: "Elements"
|
||||
assert_selector 'h1', text: 'Elemente'
|
||||
end
|
||||
|
||||
test "should create element" do
|
||||
test 'should create element' do
|
||||
visit elements_url
|
||||
click_on "New element"
|
||||
click_on 'Element hinzufügen'
|
||||
|
||||
fill_in "Description", with: @element.description
|
||||
fill_in "Path", with: @element.path
|
||||
fill_in "Report", with: @element.report_id
|
||||
fill_in "Title", with: @element.title
|
||||
click_on "Create Element"
|
||||
|
||||
assert_text "Element was successfully created"
|
||||
click_on "Back"
|
||||
fill_in_rich_text_area 'Details', with: @element.description
|
||||
fill_in 'Pfad', with: @element.path
|
||||
fill_in 'Beschreibung', with: @element.title
|
||||
click_on 'Element erstellen'
|
||||
end
|
||||
|
||||
test "should update Element" do
|
||||
test 'should update Element' do
|
||||
visit element_url(@element)
|
||||
click_on "Edit this element", match: :first
|
||||
click_on 'Element bearbeiten', match: :first
|
||||
|
||||
fill_in "Description", with: @element.description
|
||||
fill_in "Path", with: @element.path
|
||||
fill_in "Report", with: @element.report_id
|
||||
fill_in "Title", with: @element.title
|
||||
click_on "Update Element"
|
||||
|
||||
assert_text "Element was successfully updated"
|
||||
click_on "Back"
|
||||
fill_in_rich_text_area 'Details', with: @element.description
|
||||
fill_in 'Pfad', with: @element.path
|
||||
fill_in 'Beschreibung', with: @element.title
|
||||
click_on 'Element aktualisieren'
|
||||
end
|
||||
|
||||
test "should destroy Element" do
|
||||
test 'should destroy Element' do
|
||||
visit element_url(@element)
|
||||
click_on "Destroy this element", match: :first
|
||||
|
||||
assert_text "Element was successfully destroyed"
|
||||
click_on 'Element löschen', match: :first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue