basic entity get/show

This commit is contained in:
2023-01-13 21:47:31 +02:00
parent 26ea76c8e9
commit 38f51a5de6
13 changed files with 74 additions and 38 deletions

View File

@ -17,7 +17,7 @@ class EntitiesControllerTest < ActionDispatch::IntegrationTest
test "should create entity" do
assert_difference("Entity.count") do
post entities_url, params: { entity: { ha_id: @entity.ha_id, name: @entity.name, type: @entity.type } }
post entities_url, params: { entity: { ha_id: @entity.ha_id, member_id: @entity.member_id, name: @entity.name, type: @entity.type } }
end
assert_redirected_to entity_url(Entity.last)
@ -34,7 +34,7 @@ class EntitiesControllerTest < ActionDispatch::IntegrationTest
end
test "should update entity" do
patch entity_url(@entity), params: { entity: { ha_id: @entity.ha_id, name: @entity.name, type: @entity.type } }
patch entity_url(@entity), params: { entity: { ha_id: @entity.ha_id, member_id: @entity.member_id, name: @entity.name, type: @entity.type } }
assert_redirected_to entity_url(@entity)
end

View File

@ -4,8 +4,10 @@ one:
name: MyString
ha_id: MyString
type:
member: one
two:
name: MyString
ha_id: MyString
type:
member: two

View File

@ -15,6 +15,7 @@ class EntitiesTest < ApplicationSystemTestCase
click_on "New entity"
fill_in "Ha", with: @entity.ha_id
fill_in "Member", with: @entity.member_id
fill_in "Name", with: @entity.name
fill_in "Type", with: @entity.type
click_on "Create Entity"
@ -28,6 +29,7 @@ class EntitiesTest < ApplicationSystemTestCase
click_on "Edit this entity", match: :first
fill_in "Ha", with: @entity.ha_id
fill_in "Member", with: @entity.member_id
fill_in "Name", with: @entity.name
fill_in "Type", with: @entity.type
click_on "Update Entity"