Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uncommented test, changed Rails 3 app to Rails app. At the moment kee…
…p the name to rails-3-app as it creates an error if changed
- Loading branch information
Showing
1 changed file
with
61 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
#Feature: Allow Cucumber to rescue exceptions | ||
# | ||
# Background: A controller that raises an exception | ||
# Given I have created a new Rails 3 app "rails-3-app" and installed cucumber-rails | ||
# And I write to "app/controllers/posts_controller.rb" with: | ||
# """ | ||
# class PostsController < ApplicationController | ||
# def index | ||
# raise "There is an error in index" | ||
# end | ||
# end | ||
# """ | ||
# And I write to "config/routes.rb" with: | ||
# """ | ||
# Rails3App::Application.routes.draw do | ||
# resources :posts | ||
# end | ||
# """ | ||
# | ||
# Scenario: Allow rescue | ||
# Given I write to "features/posts.feature" with: | ||
# """ | ||
# Feature: posts | ||
# @allow-rescue | ||
# Scenario: See posts | ||
# When I look at the posts | ||
# """ | ||
# And I write to "features/step_definitions/posts_steps.rb" with: | ||
# """ | ||
# When /^I look at the posts$/ do | ||
# visit '/posts' | ||
# end | ||
# """ | ||
# And I run `bundle exec rake db:migrate` | ||
# And I run `bundle exec cucumber` | ||
# Then it should pass with: | ||
# """ | ||
# 1 scenario (1 passed) | ||
# 1 step (1 passed) | ||
# """ | ||
# | ||
# Scenario: Don't allow rescue | ||
# Given I write to "features/posts.feature" with: | ||
# """ | ||
# Feature: posts | ||
# Scenario: See them | ||
# When I look at the posts | ||
# """ | ||
# And I write to "features/step_definitions/posts_steps.rb" with: | ||
# """ | ||
# When /^I look at the posts$/ do | ||
# visit '/posts' | ||
# end | ||
# """ | ||
# And I run `bundle exec rake db:migrate` | ||
# And I run `bundle exec cucumber` | ||
# Then it should fail with: | ||
# """ | ||
# 1 scenario (1 failed) | ||
# 1 step (1 failed) | ||
# """ | ||
Feature: Allow Cucumber to rescue exceptions | ||
|
||
Background: A controller that raises an exception | ||
Given I have created a new Rails app "rails-3-app" and installed cucumber-rails | ||
And I write to "app/controllers/posts_controller.rb" with: | ||
""" | ||
class PostsController < ApplicationController | ||
def index | ||
raise "There is an error in index" | ||
end | ||
end | ||
""" | ||
And I write to "config/routes.rb" with: | ||
""" | ||
Rails3App::Application.routes.draw do | ||
resources :posts | ||
end | ||
""" | ||
|
||
Scenario: Allow rescue | ||
Given I write to "features/posts.feature" with: | ||
""" | ||
Feature: posts | ||
@allow-rescue | ||
Scenario: See posts | ||
When I look at the posts | ||
""" | ||
And I write to "features/step_definitions/posts_steps.rb" with: | ||
""" | ||
When /^I look at the posts$/ do | ||
visit '/posts' | ||
end | ||
""" | ||
And I run `bundle exec rake db:migrate` | ||
And I run `bundle exec cucumber` | ||
Then it should pass with: | ||
""" | ||
1 scenario (1 passed) | ||
1 step (1 passed) | ||
""" | ||
|
||
Scenario: Don't allow rescue | ||
Given I write to "features/posts.feature" with: | ||
""" | ||
Feature: posts | ||
Scenario: See them | ||
When I look at the posts | ||
""" | ||
And I write to "features/step_definitions/posts_steps.rb" with: | ||
""" | ||
When /^I look at the posts$/ do | ||
visit '/posts' | ||
end | ||
""" | ||
And I run `bundle exec rake db:migrate` | ||
And I run `bundle exec cucumber` | ||
Then it should fail with: | ||
""" | ||
1 scenario (1 failed) | ||
1 step (1 failed) | ||
""" |