Skip to content

Commit

Permalink
Indents
Browse files Browse the repository at this point in the history
  • Loading branch information
nyarly committed Sep 21, 2015
1 parent 51cb9d6 commit df12313
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions doc/README
Expand Up @@ -13,33 +13,34 @@ https://github.com/LRDesign/two-step )
One excellent example is web site integration tests. With RSpec steps you can
do:

steps "Login and change password" do
it "should show the login form" do
visit root
page.should have_text "Login"
end

it "should successfully log in" do
fill_in :name, "Johnny User"
click "Login"
page.should have_text "Welcome, Johnny!"
end

it "should load the password change form" do
click "My Settings"
click "Update Password"
page.should have_selector("form#update_password")
end

it "should change the user's password successfully" do
fill_in :password, "foobar"
fill_in :password_confirmation, "foobar"
click "Change Password"
page.should have_text "Password changed successfully!"
User.find_by_name("Johnny User").valid_password?("foobar").should be_true
end

end
```ruby
RSpec::Steps.steps "Login and change password" do
it "should show the login form" do
visit root
page.should have_text "Login"
end

it "should successfully log in" do
fill_in :name, "Johnny User"
click "Login"
page.should have_text "Welcome, Johnny!"
end

it "should load the password change form" do
click "My Settings"
click "Update Password"
page.should have_selector("form#update_password")
end

it "should change the user's password successfully" do
fill_in :password, "foobar"
fill_in :password_confirmation, "foobar"
click "Change Password"
page.should have_text "Password changed successfully!"
User.find_by_name("Johnny User").valid_password?("foobar").should be_true
end
end
```

The examples above will be run in order. State is preserved between examples
inside a "steps" block: any DB transactions will not roll back until the entire
Expand Down Expand Up @@ -74,7 +75,7 @@ As of 2.0, Steps no longer automatically adds its DSL to the top level. If you
want that behavior (especially if you're updating an older project) add:

```
require 'rspec-steps/monkeypatch'
require 'rspec-steps/monkeypatching'
```
to e.g. `spec_helper.rb.`

Expand Down

0 comments on commit df12313

Please sign in to comment.