Skip to content

Commit

Permalink
Added some missing "do" keywords.
Browse files Browse the repository at this point in the history
  • Loading branch information
Clemens Fuchslocher committed Jan 12, 2013
1 parent bd69f42 commit e070f5a
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1024,12 +1024,12 @@ they will retry the match for given timeout allowing you to test ajax actions.
end
# the spec...
describe Article
describe '#summary'
describe Article do
describe '#summary' do
#...
end

describe '.latest'
describe '.latest' do
#...
end
end
Expand Down Expand Up @@ -1229,7 +1229,7 @@ they will retry the match for given timeout allowing you to test ajax actions.
# spec/views/articles/show.html.haml_spec.rb
describe 'articles/show.html.haml' do
it 'displays the formatted date of article publishing'
it 'displays the formatted date of article publishing' do
article = mock_model(Article, published_at: Date.new(2012, 01, 01))
assign(:article, article)
Expand Down Expand Up @@ -1344,15 +1344,15 @@ they will retry the match for given timeout allowing you to test ajax actions.
* Create the model for all examples in the spec to avoid duplication.

```Ruby
describe Article
describe Article do
let(:article) { Fabricate(:article) }
end
```

* Add an example ensuring that the fabricated model is valid.

```Ruby
describe Article
describe Article do
it 'is valid with valid attributes' do
article.should be_valid
end
Expand All @@ -1365,15 +1365,15 @@ which should be validated. Using `be_valid` does not guarantee that the problem

```Ruby
# bad
describe '#title'
describe '#title' do
it 'is required' do
article.title = nil
article.should_not be_valid
end
end
# prefered
describe '#title'
describe '#title' do
it 'is required' do
article.title = nil
article.should have(1).error_on(:title)
Expand All @@ -1384,8 +1384,8 @@ which should be validated. Using `be_valid` does not guarantee that the problem
* Add a separate `describe` for each attribute which has validations.

```Ruby
describe Article
describe '#title'
describe Article do
describe '#title' do
it 'is required' do
article.title = nil
article.should have(1).error_on(:title)
Expand All @@ -1397,8 +1397,8 @@ which should be validated. Using `be_valid` does not guarantee that the problem
* When testing uniqueness of a model attribute, name the other object `another_object`.

```Ruby
describe Article
describe '#title'
describe Article do
describe '#title' do
it 'is unique' do
another_article = Fabricate.build(:article, title: article.title)
article.should have(1).error_on(:title)
Expand All @@ -1417,10 +1417,10 @@ which should be validated. Using `be_valid` does not guarantee that the problem
* the e-mail contains the required information

```Ruby
describe SubscriberMailer
describe SubscriberMailer do
let(:subscriber) { mock_model(Subscription, email: '[email protected]', name: 'John Doe') }
describe 'successful registration email'
describe 'successful registration email' do
subject { SubscriptionMailer.successful_registration_email(subscriber) }
its(:subject) { should == 'Successful Registration!' }
Expand Down

0 comments on commit e070f5a

Please sign in to comment.