basic entity get/show
This commit is contained in:
@ -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
|
||||
|
||||
|
2
test/fixtures/entities.yml
vendored
2
test/fixtures/entities.yml
vendored
@ -4,8 +4,10 @@ one:
|
||||
name: MyString
|
||||
ha_id: MyString
|
||||
type:
|
||||
member: one
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
ha_id: MyString
|
||||
type:
|
||||
member: two
|
||||
|
@ -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"
|
||||
|
Reference in New Issue
Block a user