Update PR with master

Rebase master branch so that this PR can
be updated with the latest changes.
Conflicts has been solved. dev_seeds
has been also adapted to the new format
(it all separated to be easier to manage).
Some specs has been updated to work with
selenium-webkit.
This commit is contained in:
iagirre
2018-04-02 15:41:08 +02:00
committed by Angel Perez
parent 82cb8d4c52
commit 5ce08532cb
2 changed files with 18 additions and 2 deletions

View File

@@ -17,3 +17,11 @@ section "Creating banners" do
created_at: rand((Time.current - 1.week)..Time.current))
end
end
section "Creating web sections" do
WebSection.create(name: 'homepage')
WebSection.create(name: 'debates')
WebSection.create(name: 'proposals')
WebSection.create(name: 'budgets')
WebSection.create(name: 'more_info')
end

View File

@@ -108,6 +108,14 @@ feature 'Admin banners magement' do
fill_in 'banner_background_color', with: '#850000'
fill_in 'banner_font_color', with: '#ffb2b2'
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.
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
@@ -145,8 +153,8 @@ feature 'Admin banners magement' do
fill_in 'banner_title', with: 'Modified title'
fill_in 'banner_description', with: 'Edited text'
select 'Banner style 1', from: 'banner_style'
select 'Banner image 2', from: 'banner_image'
page.find("body").click
within('div#js-banner-background') do
expect(page).to have_selector('h2', text: 'Modified title')