From 306b6d896724d2f48a0750c06fbb607bf75e2743 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Wed, 11 Jul 2018 09:55:09 -0400 Subject: [PATCH] Fix failing admin/banners scenario --- spec/features/admin/banners_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/features/admin/banners_spec.rb b/spec/features/admin/banners_spec.rb index 9d001620d..59db31b27 100644 --- a/spec/features/admin/banners_spec.rb +++ b/spec/features/admin/banners_spec.rb @@ -110,17 +110,17 @@ feature 'Admin banners magement' do fill_in 'banner_background_color', with: '#850000' fill_in 'banner_font_color', with: '#ffb2b2' + fill_in 'banner_title', with: 'Fun with flags' - page.find("body").click - # This simulates the blur event on the page. The color pickers and the text_fields has onChange events - # that update each one when the other changes, but this is only fired when the text_field loses the - # focus (color picker update when text_field changes). The first one works because when the test - # fills in the second one, the first loses the focus (so the onChange is fired). The second one never - # loses the focus, so the onChange is not been fired. page.find("body").click clicks out of the - # text_field and makes the field to lose the focus. + # This last step simulates the blur event on the page. The color pickers and the text_fields + # has onChange events that update each one when the other changes, but this is only fired when + # the text_field loses the focus (color picker update when text_field changes). The first one + # works because when the test fills in the second one, the first loses the focus + # (so the onChange is fired). The second one never loses the focus, so the onChange is not been fired. + # The `fill_in` action clicks out of the text_field and makes the field to lose the focus. - expect(page.find_field("banner_background_color_picker").value).to eq('#850000') - expect(page.find_field("banner_font_color_picker").value).to eq('#ffb2b2') + expect(find("#banner_background_color_picker").value).to eq('#850000') + expect(find("#banner_font_color_picker").value).to eq('#ffb2b2') end scenario 'Edit banner with live refresh', :js do