Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
drogus committed Aug 2, 2011
0 parents commit ff52e22
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 0 deletions.
163 changes: 163 additions & 0 deletions one/01_slide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
!SLIDE
# We buried fixtures too soon #
## Piotr Sarnacki ##

!SLIDE

# @drogus #

!SLIDE bullets incremental

# Historia #

* Rails
* Test/Unit
* Fixtures

!SLIDE center

# Wtem... #

!SLIDE center

![](troll-factories.png)

!SLIDE

## I od tej pory każdy pieprzony projekt w Railsach używa fabryk... ##

!SLIDE center

![](troll-problem.png)

!SLIDE

# Czy fixtures to naprawdę zło wcielone? #

!SLIDE bullets incremental

# Fixtures - zalety #

* gotowy zestaw do *większości* testów
* szybkość (raz wczytane do bazy, później w użyciu są transakcje)
* można użyć podczas developmentu jako zestaw podstawowych danych

!SLIDE bullets incremental

# Fixtures - wady #

* ciężko jest ogarnąć stan bazy danych w dużym projekcie
* w plikach yml zachowane są wartości wrzucane bezpośrednio do bazy danych
* kiepskie przy jakichkolwiek edge cases

!SLIDE center

## Po co nam o tym mówisz? Przecież wszyscy używają fabryk i wiedzą, że są lepsze! ##

!SLIDE center

![](pedo-sad-panda.png)

!SLIDE center

![](sadpanda.gif)

!SLIDE center

![](righttool.png)

!SLIDE center

# RIGHT TOOL FOR THE JOB #

!SLIDE bullets incremental

# Gdzie się sprawdzają fixtures? #

* projekty ze skomplikowanymi zależnościami
* rzadko zmieniające się dane (kategorie, województwa)
* projekty, w których większość testów potrzebuje podobnego setupu

!SLIDE center

## Ale przecież fixtures mają tyle wad! :( ##

!SLIDE center

![](go_cry_emo_kid.jpg)

!SLIDE bullets

# Fixtures - wady #

* ciężko jest ogarnąć stan bazy danych w dużym projekcie
* w plikach yml zachowane są wartości wrzucane bezpośrednio do bazy danych
* kiepskie przy jakichkolwiek edge cases

!SLIDE bullets incremental

## ciężko jest ogarnąć stan bazy danych w dużym projekcie ##

* niestety, raczej nie do obejścia

!SLIDE bullets incremental

## kiepskie przy jakichkolwiek edge cases ##

* wystarczy do takich przypadków dorzucić fabryki

!SLIDE

@@@ruby
user = users(:johnny)
edge_case_user =
Factory.create(:login => "bob")


!SLIDE bullets incremental

## w plikach yml zachowane są wartości wrzucane bezpośrednio do bazy danych ##

* fixtures wcale nie muszą być generowane z plików YML

!SLIDE center

## Wait a minute... ! ##

!SLIDE center

## Jak w takim razie generować fixtures? ##

!SLIDE

# Fixtories! #

@@@ruby
Fixtories.define(:user) do |f|
f.create :johnny,
:email => "johnny@example.com",
:password => "secret"

f.create :bob,
:bob => "bob@example.com",
:password => "secret",
end

!SLIDE bullets incremental

# Fixtories #

* gem do wczytywania fixtures używając fabryk
* dzięki użyciu fabryk uruchamiane są normalnie callbacki i walidacje

!SLIDE

# Coming soon #

!SLIDE

# Dziękuję za uwagę #

!SLIDE

# Pytania? #
Binary file added one/go_cry_emo_kid.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added one/pedo-sad-panda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added one/righttool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added one/sadpanda.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added one/troll-factories.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added one/troll-fixtures.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added one/troll-problem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions showoff.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "name": "My Preso", "sections": [ {"section":"one"} ]}

0 comments on commit ff52e22

Please sign in to comment.