Skip to content

Instantly share code, notes, and snippets.

@felixflores
Created December 15, 2009 16:20
Show Gist options
  • Save felixflores/257052 to your computer and use it in GitHub Desktop.
Save felixflores/257052 to your computer and use it in GitHub Desktop.
Feature: Managing movies
In order manage movies
As an authorized user
I want to be able to manage movies
Background: Only authenticated users can add movies
Given a user is logged in as "[email protected]"
Given /^a user is logged in as "(.*)"$/ do |email|
user = Factory(:user, :email => email)
visit "/login"
fill_in("Email", :with => user.email)
fill_in("Password", :with => user.password)
click_button("Login")
response.should contain("Login successful!")
end
Factory.define :user do |user|
user.sequence(:email) { |n| "foo#{n}@example.com" }
user.password "foobar"
user.password_confirmation { |u| u.password }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment