From a25844d777757c7d98ec41a93063d479c0f2e542 Mon Sep 17 00:00:00 2001 From: Bilal Date: Tue, 28 Jul 2020 12:27:42 +0200 Subject: [PATCH 1/2] add header to the location releases index table --- app/views/location_releases/index.html.erb | 2 +- config/locales/en.yml | 1 + config/locales/es.yml | 1 + .../user_managing_location_releases_spec.rb | 32 +++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/app/views/location_releases/index.html.erb b/app/views/location_releases/index.html.erb index f319ea8..2aeb9f8 100644 --- a/app/views/location_releases/index.html.erb +++ b/app/views/location_releases/index.html.erb @@ -33,7 +33,7 @@ <%= t(".table_headers.notes") %> <%= t(".table_headers.tags") %> <%= t(".table_headers.signed_at") %> - + <%= t(".table_headers.amendment_signed") %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 7363cdd..f482b0b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -789,6 +789,7 @@ en: empty: Location Releases will appear here table_headers: address: Address + amendment_signed: Amendment approved: Approved name: Location Name notes: Notes diff --git a/config/locales/es.yml b/config/locales/es.yml index a4a4688..b467769 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -346,6 +346,7 @@ es: index: table_headers: address: Address (ES) + amendment_signed: Amendment (ES) notes: Notes (ES) signed_at: Date Signed (ES) tags: Tags (ES) diff --git a/spec/features/user_managing_location_releases_spec.rb b/spec/features/user_managing_location_releases_spec.rb index db3e53a..ddf4c46 100644 --- a/spec/features/user_managing_location_releases_spec.rb +++ b/spec/features/user_managing_location_releases_spec.rb @@ -127,6 +127,26 @@ feature "User managing location releases" do sign_in current_user end + scenario "Approved releases have checkmark and non-approved releases don't have checkmarks" do + create(:location_release_with_contract_template, :native, project: project) + + visit project_location_releases_path(project) + expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 0) + + create(:location_release_with_contract_template, :native, project: project, approved_by_user_email: "some@email.com", approved_at: DateTime.now) + visit project_medical_releases_path(project) + + expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 1) + end + + scenario "listing all releases, table have correct headers", js:true do + ct = create(:contract_template, :with_amendment_clause, project: project) + create(:location_release, :native, project: project, contract_template: ct) + visit project_location_releases_path(project) + + table_headers.each { |s| expect(page).to have_content s } + end + scenario "creating a release", js: true do visit new_project_location_release_path(project) @@ -729,4 +749,16 @@ feature "User managing location releases" do def amendment_signature_label t 'contracts.amendment_page.description_labels.amendment_signature' end + + def table_headers + [ + t('location_releases.index.table_headers.approved'), + t('location_releases.index.table_headers.name'), + t('location_releases.index.table_headers.address'), + t('location_releases.index.table_headers.notes'), + t('location_releases.index.table_headers.tags'), + t('location_releases.index.table_headers.signed_at'), + t('location_releases.index.table_headers.amendment_signed') + ] + end end -- 2.47.3 From 83c154899425afa757d544e6ec626b8884bf2008 Mon Sep 17 00:00:00 2001 From: Bilal Date: Tue, 28 Jul 2020 12:34:50 +0200 Subject: [PATCH 2/2] fix spec --- .../features/user_managing_location_releases_spec.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/spec/features/user_managing_location_releases_spec.rb b/spec/features/user_managing_location_releases_spec.rb index ddf4c46..3eb55de 100644 --- a/spec/features/user_managing_location_releases_spec.rb +++ b/spec/features/user_managing_location_releases_spec.rb @@ -127,18 +127,6 @@ feature "User managing location releases" do sign_in current_user end - scenario "Approved releases have checkmark and non-approved releases don't have checkmarks" do - create(:location_release_with_contract_template, :native, project: project) - - visit project_location_releases_path(project) - expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 0) - - create(:location_release_with_contract_template, :native, project: project, approved_by_user_email: "some@email.com", approved_at: DateTime.now) - visit project_medical_releases_path(project) - - expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 1) - end - scenario "listing all releases, table have correct headers", js:true do ct = create(:contract_template, :with_amendment_clause, project: project) create(:location_release, :native, project: project, contract_template: ct) -- 2.47.3