Skip to content

Add, fix Topic Page Style Guide tests#10

Merged
cheshire137 merged 2 commits into
add-testingfrom
topic-page-style-guide-tests
Oct 3, 2017
Merged

Add, fix Topic Page Style Guide tests#10
cheshire137 merged 2 commits into
add-testingfrom
topic-page-style-guide-tests

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Contributor

Turns out we were breaking our own rules 😮.

These are pretty far from perfect but without going down the full NLP rabbit hole they should be better than nothing (as demonstrated by them catching non-nothing).

Fixes #7

Comment thread test/test_helper.rb
end
end

def text_for(topic)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might call this body_for. 🤔

Comment thread test/topics_test.rb
"expected to have a value for '#{key}'"
end

it "follows the Topic Page Style Guide" do
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for keeping us honest, Mike. 😅

Comment thread test/topics_test.rb
refute_includes line, "git#{punctuation}",
'Always use correct capitalization when referring to "Git"'

(1..10).each do |digit|
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be ... to exclude 10, if we want numbers less than 10.

Comment thread test/topics_test.rb

%w[and or].each do |conjunction|
next unless sentence.include? " #{conjunction} "
assert_includes sentence, ", #{conjunction}", "Always use the Oxford comma"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 😭

@cheshire137 cheshire137 merged commit 59edaa7 into add-testing Oct 3, 2017
@cheshire137 cheshire137 deleted the topic-page-style-guide-tests branch October 3, 2017 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants