Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene
Created October 26, 2011 00:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/1314883 to your computer and use it in GitHub Desktop.
Save krainboltgreene/1314883 to your computer and use it in GitHub Desktop.
require 'coulda'
Feature 'Division' do
To 'avoid silly mistakes'
A 'cashier'
Should 'be able to calculate a fraction'
def calculator_on
Calculator.new
end
Scenario 'Regular numbers' do
Given 'the calculator is turned on' do
calculator_on
end
When 'I have enter a complete equation' do
@calculator.stack << 3
@calculator.stack << 3
end
Then 'I should have the total be 1' do
# @calculator.total.should be 1
# assert_equal @calculator.total, 1
end
end
Scenario 'Irregular numbers' # Without a block, it's pending
Scenario 'Fractional numbers' do
Given 'this is a pending given'
When 'this is a pending when'
Then 'this is a pending then'
end
Scenario 'User Authentication' do
extend ApplicationSteps
extend AccountsSteps
Given { on_home_page }
When { user_clicks('login'); user_enters_login }
Then { should_be_on "user/dashboard" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment