From c2b5083d4fa1f9e2bf2e3c74cc2739dfff27d7f4 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sat, 16 Dec 2017 17:51:58 +0100 Subject: [PATCH] Fix missing and extra spacing --- spec/features/admin/poll/booth_assigments_spec.rb | 14 +++++++------- spec/features/social_media_meta_tags_spec.rb | 8 ++++---- spec/models/budget/heading_spec.rb | 8 ++++---- spec/models/poll/booth_assignment_spec.rb | 14 +++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/spec/features/admin/poll/booth_assigments_spec.rb b/spec/features/admin/poll/booth_assigments_spec.rb index 29e1eccde..016bccb7f 100644 --- a/spec/features/admin/poll/booth_assigments_spec.rb +++ b/spec/features/admin/poll/booth_assigments_spec.rb @@ -106,33 +106,33 @@ feature 'Admin booths assignments' do expect(page).to have_content 'There are no booths assigned to this poll.' expect(page).not_to have_content booth.name end - + scenario 'Unassing booth whith associated shifts', :js do assignment = create(:poll_booth_assignment, poll: poll, booth: booth) officer = create(:poll_officer) create(:poll_officer_assignment, officer: officer, booth_assignment: assignment) create(:poll_shift, booth: booth, officer: officer) - + visit manage_admin_poll_booth_assignments_path(poll) - + within("#poll_booth_#{booth.id}") do expect(page).to have_content(booth.name) expect(page).to have_content "Assigned" click_link 'Unassign booth' - + expect(page).to have_content "Unassigned" expect(page).not_to have_content "Assigned" expect(page).to have_link "Assign booth" - end + end end - + scenario "Cannot unassing booth if poll is expired" do poll_expired = create(:poll, :expired) create(:poll_booth_assignment, poll: poll_expired, booth: booth) visit manage_admin_poll_booth_assignments_path(poll_expired) - + within("#poll_booth_#{booth.id}") do expect(page).to have_content(booth.name) expect(page).to have_content "Assigned" diff --git a/spec/features/social_media_meta_tags_spec.rb b/spec/features/social_media_meta_tags_spec.rb index d04df78f6..302e010f7 100644 --- a/spec/features/social_media_meta_tags_spec.rb +++ b/spec/features/social_media_meta_tags_spec.rb @@ -36,12 +36,12 @@ feature 'Social media meta tags' do visit root_path - expect(page).to have_css 'meta[name="keywords"][content="'+ meta_keywords + '"]', visible: false - expect(page).to have_css 'meta[name="twitter:site"][content="'+ twitter_handle + '"]', visible: false - expect(page).to have_css 'meta[name="twitter:title"][content="'+ meta_title + '"]', visible: false + expect(page).to have_css 'meta[name="keywords"][content="' + meta_keywords + '"]', visible: false + expect(page).to have_css 'meta[name="twitter:site"][content="' + twitter_handle + '"]', visible: false + expect(page).to have_css 'meta[name="twitter:title"][content="' + meta_title + '"]', visible: false expect(page).to have_css 'meta[name="twitter:description"][content="' + meta_description + '"]', visible: false expect(page).to have_css 'meta[name="twitter:image"][content="http://www.example.com/social_media_icon_twitter.png"]', visible: false - expect(page).to have_css 'meta[property="og:title"][content="'+ meta_title + '"]', visible: false + expect(page).to have_css 'meta[property="og:title"][content="' + meta_title + '"]', visible: false expect(page).to have_css 'meta[property="article:publisher"][content="' + url + '"]', visible: false expect(page).to have_css 'meta[property="article:author"][content="https://www.facebook.com/' + facebook_handle + '"]', visible: false expect(page).to have_css 'meta[property="og:url"][content="http://www.example.com/"]', visible: false diff --git a/spec/models/budget/heading_spec.rb b/spec/models/budget/heading_spec.rb index 76df1fa5c..b2f16a153 100644 --- a/spec/models/budget/heading_spec.rb +++ b/spec/models/budget/heading_spec.rb @@ -32,16 +32,16 @@ describe Budget::Heading do it "Doesn't allow population <= 0" do heading = create(:budget_heading, group: group, name: 'Population is > 0') - + heading.population = 0 expect(heading).not_to be_valid - + heading.population = -10 expect(heading).not_to be_valid - + heading.population = 10 expect(heading).to be_valid - end + end end end diff --git a/spec/models/poll/booth_assignment_spec.rb b/spec/models/poll/booth_assignment_spec.rb index 8663e3872..9ea1fd516 100644 --- a/spec/models/poll/booth_assignment_spec.rb +++ b/spec/models/poll/booth_assignment_spec.rb @@ -4,26 +4,26 @@ describe :booth_assignment do let(:poll){create(:poll)} let(:booth){create(:poll_booth)} let(:booth1){create(:poll_booth)} - + it "should check if there are shifts" do assignment_with_shifts = create(:poll_booth_assignment, poll: poll, booth: booth) assignment_without_shifts = create(:poll_booth_assignment, poll: poll, booth: booth1) officer = create(:poll_officer) create(:poll_officer_assignment, officer: officer, booth_assignment: assignment_with_shifts) - create(:poll_shift, booth: booth, officer: officer) - + create(:poll_shift, booth: booth, officer: officer) + expect(assignment_with_shifts.shifts?).to eq(true) - expect(assignment_without_shifts.shifts?).to eq(false) + expect(assignment_without_shifts.shifts?).to eq(false) end - + it "should delete shifts associated to booth assignments" do assignment = create(:poll_booth_assignment, poll: poll, booth: booth) officer = create(:poll_officer) create(:poll_officer_assignment, officer: officer, booth_assignment: assignment) create(:poll_shift, booth: booth, officer: officer) - + assignment.destroy - + expect(Poll::Shift.all.count).to eq(0) end end \ No newline at end of file