Skip to content
Permalink
Browse files

Merge pull request #200 from hanami/revert-193-patch-1

Revert "Update BookRepository methods calls"
  • Loading branch information...
jodosha committed Jun 7, 2016
2 parents ce36a6b + 7bf2498 commit fa9541678b0c9e5738fbc97b1baae55108b61f3d
Showing with 13 additions and 13 deletions.
  1. +13 −13 source/guides/getting-started.md
@@ -508,13 +508,13 @@ We can use Hanami's `console` command to launch IRb with our application pre-loa

```
% hanami console
>> BookRepository.new.all
>> BookRepository.all
=> []
>> book = Book.new(title: 'TDD', author: 'Kent Beck')
=> #<Book:0x007f9af1d4b028 @title="TDD", @author="Kent Beck">
>> BookRepository.new.create(book)
>> BookRepository.create(book)
=> #<Book:0x007f9af1d13ec0 @title="TDD", @author="Kent Beck" @id=1>
>> BookRepository.new.find(1)
>> BookRepository.find(1)
=> #<Book:0x007f9af1d13ec0 @title="TDD", @author="Kent Beck" @id=1>
```

@@ -538,8 +538,8 @@ describe 'List books' do
before do
BookRepository.clear
BookRepository.new.create(Book.new(title: 'PoEAA', author: 'Martin Fowler'))
BookRepository.new.create(Book.new(title: 'TDD', author: 'Kent Beck'))
BookRepository.create(Book.new(title: 'PoEAA', author: 'Martin Fowler'))
BookRepository.create(Book.new(title: 'TDD', author: 'Kent Beck'))
end
it 'shows a book element for each book' do
@@ -633,9 +633,9 @@ describe Web::Controllers::Books::Index do
let(:params) { Hash[] }
before do
BookRepository.new.clear
BookRepository.clear
@book = BookRepository.new.create(Book.new(title: 'TDD', author: 'Kent Beck'))
@book = BookRepository.create(Book.new(title: 'TDD', author: 'Kent Beck'))
end
it "is successful" do
@@ -662,7 +662,7 @@ module Web::Controllers::Books
expose :books
def call(params)
@books = BookRepository.new.all
@books = BookRepository.all
end
end
end
@@ -685,7 +685,7 @@ require 'features_helper'
describe 'Books' do
after do
BookRepository.new.clear
BookRepository.clear
end
it 'can create a new book' do
@@ -784,7 +784,7 @@ describe Web::Controllers::Books::Create do
let(:params) { Hash[book: { title: 'Confident Ruby', author: 'Avdi Grimm' }] }
before do
BookRepository.new.clear
BookRepository.clear
end
it 'creates a new book' do
@@ -815,7 +815,7 @@ module Web::Controllers::Books
expose :book
def call(params)
@book = BookRepository.new.create(Book.new(params[:book]))
@book = BookRepository.create(Book.new(params[:book]))
redirect_to '/books'
end
@@ -847,7 +847,7 @@ describe Web::Controllers::Books::Create do
let(:action) { Web::Controllers::Books::Create.new }
after do
BookRepository.new.clear
BookRepository.clear
end
describe 'with valid params' do
@@ -913,7 +913,7 @@ module Web::Controllers::Books
def call(params)
if params.valid?
@book = BookRepository.new.create(Book.new(params[:book]))
@book = BookRepository.create(Book.new(params[:book]))
redirect_to '/books'
end

0 comments on commit fa95416

Please sign in to comment.
You can’t perform that action at this time.