From bf69a7bba73d536830d2924d582fb5b787051da9 Mon Sep 17 00:00:00 2001 From: iagirre Date: Mon, 15 Jan 2018 12:41:54 +0100 Subject: [PATCH] Specs added to test the change of background and font color with color-picker and text-field --- config/locales/es/admin.yml | 2 -- spec/features/admin/banners_spec.rb | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 371fab679..68bdd2369 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -29,8 +29,6 @@ es: title: Título description: Descripción target_url: Enlace - style: Estilo - image: Imagen post_started_at: Inicio de publicación post_ended_at: Fin de publicación sections_label: Secciones en las que aparece diff --git a/spec/features/admin/banners_spec.rb b/spec/features/admin/banners_spec.rb index d39926cce..e58c82f20 100644 --- a/spec/features/admin/banners_spec.rb +++ b/spec/features/admin/banners_spec.rb @@ -82,8 +82,6 @@ feature 'Admin banners magement' do click_link "Create banner" - select 'Banner style 1', from: 'banner_style' - select 'Banner image 2', from: 'banner_image' fill_in 'banner_title', with: 'Such banner' fill_in 'banner_description', with: 'many text wow link' fill_in 'banner_target_url', with: 'https://www.url.com' @@ -91,6 +89,8 @@ feature 'Admin banners magement' do next_week = Time.current + 7.days fill_in 'post_started_at', with: last_week.strftime("%d/%m/%Y") fill_in 'post_ended_at', with: next_week.strftime("%d/%m/%Y") + fill_in 'banner_background_color', with: '#850000' + fill_in 'banner_font_color', with: '#ffb2b2' click_button 'Save changes' @@ -102,6 +102,16 @@ feature 'Admin banners magement' do expect(page).to have_link 'Such banner many text wow link', href: 'https://www.url.com' end + scenario "Update banner color when changing from color picker or text_field", :js do + visit new_admin_banner_path + + fill_in 'banner_background_color', with: '#850000' + fill_in 'banner_font_color', with: '#ffb2b2' + + expect(page.find_field("banner_background_color_picker").value).to eq('#850000') + expect(page.find_field("banner_font_color_picker").value).to eq('#ffb2b2') + end + scenario 'Edit banner with live refresh', :js do banner1 = create(:banner, title: 'Hello', description: 'Wrong text',