show owner info in acquired media release table

This commit is contained in:
Bilal
2020-08-04 15:08:19 +02:00
parent a7b7e1ecf9
commit 0294a480ee
6 changed files with 44 additions and 0 deletions

View File

@@ -18,6 +18,9 @@
<%= fa_icon("warning", text: t(".no_media"), class: "text-danger") %>
<% end %>
</td>
<td>
<%= contact_info_for(acquired_media_release.contact_person) %>
</td>
<td>
<%= notes_preview acquired_media_release.notes.order_by_recent %>
</td>

View File

@@ -29,6 +29,7 @@
<th><%= t '.table_headers.approved'%></th>
<th><%= AcquiredMediaRelease.human_attribute_name(:name) %></th>
<th><%= t(".table_headers.file_infos_count") %></th>
<th><%= t(".table_headers.owner_info") %></th>
<th><%= t(".table_headers.notes") %></th>
<th><%= t(".table_headers.tags") %></th>
<th><%= t(".table_headers.signed_at") %></th>

View File

@@ -67,6 +67,7 @@ en:
notes: Notes
signed_at: Date Signed
tags: Tags
owner_info: Owner Info
new:
heading: Import Acquired Media Release
update:

View File

@@ -21,6 +21,7 @@ es:
notes: Notes (ES)
signed_at: Date Signed (ES)
tags: Tags (ES)
owner_info: Owner Info (ES)
activerecord:
attributes:
appearance_release:

View File

@@ -4,6 +4,22 @@ FactoryBot.define do
name "Test Acquired Media Release"
trait :with_address do
person_address_street1 "St1"
person_address_street2 "St2"
person_address_city "City"
person_address_state "State"
person_address_zip "123"
person_address_country "US"
end
trait :with_owner_info do
person_first_name "Jane"
person_last_name "Doe"
person_phone "100-555-1001"
person_email "owner@email.com"
end
trait :native do
signature do
path = Rails.root.join("spec", "fixtures", "files", "signature.png")

View File

@@ -165,6 +165,24 @@ feature "User managing acquired_media releases" do
sign_in current_user
end
scenario "index table shows owner info" do
release = create(:acquired_media_release, :with_owner_info, :with_address, project: project)
visit project_acquired_media_releases_path(project)
expect(page).to have_content owner_info_table_header
expect(page).to have_content release.person_first_name
expect(page).to have_content release.person_last_name
expect(page).to have_content release.person_phone
expect(page).to have_content release.person_email
expect(page).to have_content release.person_address_street1
expect(page).to have_content release.person_address_city
expect(page).to have_content release.person_address_state
expect(page).to have_content release.person_address_zip
expect(page).to have_content release.person_address_country
end
scenario "creating a release for an adult", js: true do
visit new_project_acquired_media_release_path(project)
@@ -836,4 +854,8 @@ feature "User managing acquired_media releases" do
def successful_import_message
t 'acquired_media_releases.create.notice'
end
def owner_info_table_header
t 'acquired_media_releases.index.table_headers.owner_info'
end
end