This repository was archived by the owner on Nov 1, 2017. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork1.1k
Sync changes from upstream repository#937
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -18,3 +18,4 @@ tmp | ||
.bundle | ||
crash.log | ||
npm-debug.log | ||
build.txt |
6 changes: 5 additions & 1 deletionGemfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
48 changes: 46 additions & 2 deletionsGemfile.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletionRakefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionscontent/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
--- | ||
title: GitHub Developer | ||
layout: overview | ||
hide_from_search: true | ||
--- | ||
<div class="wrapper feature"> | ||
4 changes: 3 additions & 1 deletioncontent/search/search-index.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletionsscript/cibuild
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -34,10 +34,4 @@ echo "NPM version: ${NPM_VERSION}" | ||
echo "PATH: ${PATH}" | ||
echo "" | ||
script/test |
24 changes: 24 additions & 0 deletionsscript/test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# Usage: script/test | ||
# Run test suite | ||
# | ||
set -e | ||
cd "$(dirname "$0")/.." | ||
[ -z "$DEBUG" ] || set -x | ||
export RACK_ROOT=$(cd "$(dirname $0)"/.. && pwd) | ||
export RAILS_ENV="test" RACK_ENV="test" | ||
script/bootstrap | ||
echo "===> Running tests..." | ||
if [ -n "$JANKY_ID" ]; then | ||
xvfb-run -a bundle exec rake test | ||
else | ||
bundle exec rake test | ||
fi |
21 changes: 21 additions & 0 deletionsspec/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
### What's in the *spec* folder? | ||
This folder contains (almost) our entire test suite. We split these tests into different subfolders in this directory. | ||
In addition, we use [HTML-Proofer](https://github.com/gjtorikian/html-proofer) to validate our built site. More on this below. | ||
The tests in this directory include: | ||
* The *content* folder contains tests which are run over our Markdown and YAML files before they are built. These tests include: | ||
* Ensuring that reusables are written correctly. | ||
* Ensuring that there are no Liquid errors. | ||
* Ensuring that there are no search errors. | ||
* The *features* folder contains tests that deal with how the site functions. These tests include: | ||
* Whether the search links are valid. | ||
* Whether the sidebar is working. | ||
* Whether redirects are working. | ||
There are two more types of tests that are controlled by HTML-Proofer: | ||
* HTML-Proofer validates that our *internal* content is working. That means that internal links are working, our images have alt tags, etc. | ||
* HTML-Proofer also validates our *external* content. That means URLs to external websites, external images, etc. |
30 changes: 30 additions & 0 deletionsspec/content/validity_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'spec_helper' | ||
describe 'Validity' do | ||
it 'has no Liquid errors' do | ||
failed_files = [] | ||
Dir.glob('output/**/*.html').each do |html_path| | ||
html = File.read(html_path) | ||
failed_files.push(html_path) if html =~ /Liquid error/ | ||
end | ||
unless failed_files.empty? | ||
fail "Found files with broken Liquid syntax!\n\nThe following files are broken:\n #{failed_files.join("\n")}" | ||
end | ||
end | ||
it 'has no unresolved conrefs' do | ||
failed_files = [] | ||
Dir.glob('output/**/*.html').each do |html_path| | ||
html = File.read(html_path) | ||
failed_files.push(html_path) if html =~ /{{ site.data/ | ||
end | ||
unless failed_files.empty? | ||
fail "Found #{failed_files.length} files with unresolved conrefs! These are conrefs that still say `{{ site.data` in the output.\n\nThe following files are not resolving: #{failed_files.join("\n")}" | ||
end | ||
end | ||
it 'has a working search' do | ||
output = `jsonlint output/search/search-index.json` | ||
fail output unless output.empty? | ||
end | ||
end |
10 changes: 10 additions & 0 deletionsspec/features/navigation_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'spec_helper' | ||
describe 'Navigation', js: true do | ||
it 'expands the sidebar properly' do | ||
visit "/v3/misc/" | ||
expect(page).to have_css('.js-current') | ||
expect(page.first(:css, '.js-current').text).to match('Miscellaneous') | ||
end | ||
end |
17 changes: 17 additions & 0 deletionsspec/features/redirects_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'spec_helper' | ||
describe 'Page Redirects' do | ||
context 'without javascript' do | ||
it 'shows the redirect page' do | ||
visit '/changes/2012-9-5-watcher-api/' | ||
expect(page).to have_text('Click here if you are not redirected.') | ||
end | ||
end | ||
context 'with javascript', js: true do | ||
it 'understands a normal redirect' do | ||
visit '/changes/2012-9-5-watcher-api/' | ||
expect(page).to have_text('What used to be known as "Watching" is now "Starring"') | ||
end | ||
end | ||
end |
15 changes: 15 additions & 0 deletionsspec/features/search_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'spec_helper' | ||
require 'json' | ||
describe 'Search JSON' do | ||
it 'has valid search URLs' do | ||
Dir.glob('output/search/search-index.json').each do |search_json_path| | ||
json = JSON.parse(File.read(search_json_path)) | ||
urls = json.map { |e| "output#{e['url']}/index.html" } | ||
missing_files = urls.select { |u| !File.exist?(u) } | ||
unless missing_files.empty? | ||
fail "Found links in #{search_json_path} search to articles that don't exist. That means that the search is potentially broken!\n\nThe following files couldn't be found: #{missing_files.join("\n")}" | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.