From 80d99b71a990a4ae420d6098cc56801917624a03 Mon Sep 17 00:00:00 2001 From: decabeza Date: Fri, 24 Nov 2017 14:14:41 +0100 Subject: [PATCH] adds specs --- spec/features/social_media_meta_tags_spec.rb | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 spec/features/social_media_meta_tags_spec.rb diff --git a/spec/features/social_media_meta_tags_spec.rb b/spec/features/social_media_meta_tags_spec.rb new file mode 100644 index 000000000..6cc8ee41a --- /dev/null +++ b/spec/features/social_media_meta_tags_spec.rb @@ -0,0 +1,31 @@ +require 'rails_helper' + +feature 'Social media meta tags' do + + context 'Setting social media meta tags' do + + before do + Setting['meta_keywords'] = "citizen, participation, open government" + Setting['meta_title'] = "CONSUL" + Setting['meta_description'] = "Citizen Participation and Open Government Application" + end + + after do + Setting['meta_keywords'] = nil + Setting['meta_title'] = nil + Setting['meta_description'] = nil + end + + scenario 'Social media meta tags partial render settings content' do + + visit root_path + + expect(page).to have_css 'meta[name="keywords"][content="citizen, participation, open government"]', visible: false + expect(page).to have_css 'meta[name="twitter:title"][content="CONSUL"]', visible: false + expect(page).to have_css 'meta[name="twitter:title"][content="CONSUL"]', visible: false + expect(page).to have_css 'meta[property="og:title"][content="CONSUL"]', visible: false + expect(page).to have_css 'meta[property="og:description"][content="Citizen Participation and Open Government Application"]', visible: false + end + end + +end