generated from just-the-docs/just-the-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6dec7c
commit 9bfddad
Showing
5 changed files
with
121 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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,5 @@ | ||
{ | ||
"[html]": { | ||
"editor.formatOnSave": false | ||
}, | ||
} |
This file contains 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
This file contains 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,43 @@ | ||
.bad, | ||
.good { | ||
background: #e8e8e8; | ||
padding: 5px 0px 0px 0; | ||
|
||
&::before { | ||
padding: 0 10px; | ||
} | ||
|
||
.highlight { | ||
margin-top: 3px; | ||
} | ||
} | ||
|
||
.bad { | ||
color: red; | ||
|
||
&::before { | ||
content: "BAD"; | ||
} | ||
} | ||
|
||
.good { | ||
color: green; | ||
|
||
&::before { | ||
content: "GOOD"; | ||
} | ||
} | ||
|
||
.main-content { | ||
article:not(:last-child) { | ||
margin-bottom: 4em; | ||
} | ||
|
||
h2 { | ||
&:first-child { | ||
margin-top: 0; | ||
} | ||
|
||
margin-bottom: 0.75em; | ||
} | ||
} |
This file contains 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,63 @@ | ||
--- | ||
title: Home | ||
layout: home | ||
--- | ||
|
||
<article> | ||
<h2 id="describe"> | ||
<a href="#describe"> | ||
Describe what you are testing | ||
</a> | ||
</h2> | ||
|
||
<p>Be clear about what method you are describing. For instance, use the Ruby documentation convention of <code>.</code> when referring to a class method's name and <code>#</code> when referring to an instance method's name.</p> | ||
|
||
<div class="bad"> | ||
{% highlight ruby %} | ||
describe 'the authenticate method for User' do | ||
describe 'if the user is an admin' do | ||
{% endhighlight %} | ||
</div> | ||
|
||
<div class="good"> | ||
{% highlight ruby %} | ||
describe '.authenticate' do | ||
describe '#admin?' do | ||
{% endhighlight %} | ||
</div> | ||
</article> | ||
|
||
|
||
<article> | ||
<h2 id="use-context"> | ||
<a href="#use-context"> | ||
Use context | ||
</a> | ||
</h2> | ||
|
||
<p>Contexts are a powerful way to make your tests clear and well organized (they keep tests easy to read). They should start with <code>when</code>.</p> | ||
|
||
<div class="bad"> | ||
{% highlight ruby %} | ||
it 'has 200 status code if logged in' do | ||
expect(response).to respond_with 200 | ||
end | ||
|
||
it 'has 401 status code if not logged in' do | ||
expect(response).to respond_with 401 | ||
end | ||
{% endhighlight %} | ||
</div> | ||
|
||
<div class="good"> | ||
{% highlight ruby %} | ||
context 'when logged in' do | ||
it { is_expected.to respond_with 200 } | ||
end | ||
|
||
context 'when logged out' do | ||
it { is_expected.to respond_with 401 } | ||
end | ||
{% endhighlight %} | ||
</div> | ||
</article> |