Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta description #149

Merged
merged 1 commit into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/web/templates/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ html lang="en"
meta name="viewport" content="width=device-width, initial-scale=1.0"
meta name= "twitter:title" content="OSS Board"
meta name= "twitter:url" content="http://www.ossboard.org"
meta name= "twitter:description" content="A simple way to connect developers and open-source maintainers"
meta name= "twitter:description" content= description
meta name="twitter:image" content="http://www.ossboard.org/assets/header-logo.png"
meta property="og:image" content="http://www.ossboard.org/assets/header-logo.png"
meta property="og:url" content="http://www.ossboard.org"
meta property="og:description" content="A simple way to connect developers and open-source maintainers"
meta property="og:description" content= description
meta property="og:title" content="OSS Board"
meta name="description" content= description

- if Hanami.env?(:production)
link rel="stylesheet" href="/web.css"
Expand Down
4 changes: 4 additions & 0 deletions apps/web/views/application_layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def title
'OSSBoard'
end

def description
'A simple way to connect developers and open-source maintainers'
end

private

COMPLEXITY_OPTIONS_HASH = {
Expand Down
9 changes: 7 additions & 2 deletions spec/web/features/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ def expect_headers(*headers)
end

RSpec.describe 'Index page', type: :feature, js: true do

include IndexPageSwitcher

it 'renders meta tags' do
visit '/'

expect(page).to have_selector('title', text: 'OSSBoard', visible: false)
expect(page).to have_css('meta[name="description"]', visible: false)
end

it 'switcher on index page with "I want to contribute" default switch position' do
visit '/'

Expand All @@ -39,5 +45,4 @@ def expect_headers(*headers)
page.find('.whatisthis-choice-item__link', text: 'I want to contribute').click
expect_i_want_to_contribute
end

end
4 changes: 4 additions & 0 deletions spec/web/views/main/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
it { expect(view.title).to eq 'OSSBoard' }
end

describe '#description' do
it { expect(view.description).to be }
end

describe '#link_to_tasks' do
it 'returns link to all tasks' do
expect(view.link_to_tasks.to_s).to eq '<a class="issues-all__link" href="/tasks">View all</a>'
Expand Down