changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec_on_rails/stories/transactions_should_rollback.rb

changeset 16: 01fd3f10ae84
author: moriq@moriq.com
date: Mon Mar 10 10:13:18 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec_on_rails
1require File.join(File.dirname(__FILE__), *%w[helper])
2
3Story "transactions should rollback", %{
4 As an RSpec/Rails Story author
5 I want transactions to roll back between scenarios
6 So that I can have confidence in the state of the database
7}, :type => RailsStory do
8 Scenario "add one Person" do
9 When "I add a Person" do
10 Person.create!(:name => "Foo")
11 end
12 end
13
14 Scenario "add another person" do
15 GivenScenario "add one Person"
16 Then "there should be one person" do
17 Person.count.should == 1
18 end
19 end
20
21 Scenario "add yet another person" do
22 GivenScenario "add one Person"
23 Then "there should be one person"
24 end
25end