Skip to content

Instantly share code, notes, and snippets.

View aslakhellesoy's full-sized avatar
🤠
typing...

Aslak Hellesøy aslakhellesoy

🤠
typing...
View GitHub Profile
describe "Given logged in, Homepage: url(:home)" do
before(:each) do
@rack = request(:home)
login
end
it "allows the user to visit" do
@rack.should be_successful
@rack.body.should == "Welcome"
end
Given /^I am logged in as "(.+)"$/ do |user|
Given %{a user exists with login "#{user}" and password "thedude"}
Given %{I go to /login"
Given %{I fill in "login" with "#{user}"}
Given %{I fill in "password" with "thedude"}
Given %{I press "Login"}
end
Scenario Outline: Shortcode Generated
Feature: submit guess
The code-breaker submits a guess of four colored
pegs. The mastermind game marks the guess with black
and white "marker" pegs.
For each peg in the guess that matches color
and position of a peg in the secret code, the
mark includes one black peg. For each additional
peg in the guess that matches the color but not
Feature: submit guess
The code-breaker submits a guess of four colored
pegs. The mastermind game marks the guess with black
and white "marker" pegs.
For each peg in the guess that matches color
and position of a peg in the secret code, the
mark includes one black peg. For each additional
peg in the guess that matches the color but not
## NOTE
The error refers to the first line of the second multi-line pre-scenario comments
## sessions.feature file
Users want to know that nobody can masquerade as them. We want to extend trust
only to visitors who present the appropriate credentials. Everyone wants this
identity verification to be as secure and convenient as possible.
Feature: Logging in
it 'should do something' do
on_failure warn_that "@foo shouldn't be nil" do
@foo.should_not be_nil
end
end
.run
.info
date command project etc.
.summary
overview of run envisage this as being something like the progress output, with each entry being either a relative link to the feature or a drill into the feature
%ol.features
%li.feature.pass .
%li.feature.pass .
%li.feature.fail f
%li.feature.pending p
Scenario: User attempts to redeem a valid PIN, but there is a network issue
Given an activated user logged in as 'testuser'
And an active PIN code
And the connection to CardService fails
When she redeems the PIN code
Then she should be at the 'redemption/error.html.erb' page
And she should see a notice message 'Temporary problem with PIN redemption'
And the connection to CardService recovers
Scenario: User redeems a valid (active) PIN
Scenario Outline: Religious menus
Given I am "<Religion>"
When I ask to see a menu
Then I should be presented a menu with meats entrees
<Pork..Veal>
And I should be presented a menu with hamburger types
<Hamburger..Cheeseburger>
Examples:
| Religion | Pork | Lamb | Veal | Hamburger | Cheeseburger |
Then /^I should be logged in$/ do
UserSession.find.should_not == nil # RSpec style
assert_not_nil UserSession.find # Test::Unit style
end