Fix cucumber features

This commit is contained in:
Raphael 2011-02-02 18:49:45 -08:00
parent 7c59a5b4bd
commit 636242283b
3 changed files with 18 additions and 6 deletions

View file

@ -23,8 +23,8 @@ class Profile < ActiveRecord::Base
validates_length_of :first_name, :maximum => 32 validates_length_of :first_name, :maximum => 32
validates_length_of :last_name, :maximum => 32 validates_length_of :last_name, :maximum => 32
validates_format_of :first_name, :with => /\A[^;]+\z/ validates_format_of :first_name, :with => /\A[^;]+\z/, :allow_nil => true
validates_format_of :last_name, :with => /\A[^;]+\z/ validates_format_of :last_name, :with => /\A[^;]+\z/, :allow_nil => true
attr_accessible :first_name, :last_name, :image_url, :image_url_medium, attr_accessible :first_name, :last_name, :image_url, :image_url_medium,
:image_url_small, :birthday, :gender, :bio, :searchable, :date :image_url_small, :birthday, :gender, :bio, :searchable, :date

View file

@ -5,6 +5,8 @@ Feature: posting
I want to tell the world I am eating a yogurt I want to tell the world I am eating a yogurt
Scenario: post to all aspects Scenario: post to all aspects
Given that I am a rock star
And I have no open aspects saved
Given I am signed in Given I am signed in
And I have an aspect called "Family" And I have an aspect called "Family"
And I am on the home page And I am on the home page
@ -12,33 +14,39 @@ Feature: posting
When I fill in "status_message_fake_message" with "I am eating a yogurt" When I fill in "status_message_fake_message" with "I am eating a yogurt"
And I press "Share" And I press "Share"
And I am on the home page And I follow "Home"
Then I should see "I am eating a yogurt" within ".stream_element" Then I should see "I am eating a yogurt" within ".stream_element"
Scenario: delete a post Scenario: delete a post
Given that I am a rock star
And I have no open aspects saved
Given I am signed in Given I am signed in
And I have an aspect called "Family" And I have an aspect called "Family"
And I am on the home page And I am on the home page
And I expand the publisher And I expand the publisher
When I fill in "status_message_fake_message" with "I am eating a yogurt" When I fill in "status_message_fake_message" with "I am eating a yogurt"
And I press "Share" And I press "Share"
And I am on the home page And I follow "Home"
And I hover over the post And I hover over the post
And I preemptively confirm the alert And I preemptively confirm the alert
And I press the first ".delete" within ".stream_element" And I press the first ".delete" within ".stream_element"
And I am on the home page And I follow "Home"
Then I should not see "I am eating a yogurt" Then I should not see "I am eating a yogurt"
Scenario Outline: post to one aspect Scenario Outline: post to one aspect
Given I have no open aspects saved Given that I am a rock star
And I have no open aspects saved
Given I am signed in Given I am signed in
And I have an aspect called "PostTo" And I have an aspect called "PostTo"
And I have an aspect called "DidntPostTo" And I have an aspect called "DidntPostTo"
And I am on the home page And I am on the home page
When I follow "PostTo" When I follow "PostTo"
And I wait for the ajax to finish
And I expand the publisher
And I fill in "status_message_fake_message" with "I am eating a yogurt" And I fill in "status_message_fake_message" with "I am eating a yogurt"
And I press "Share" And I press "Share"
And I follow "Home"
And I follow "<aspect>" And I follow "<aspect>"
Then I should <see> "I am eating a yogurt" Then I should <see> "I am eating a yogurt"

View file

@ -4,6 +4,10 @@ Given /^a user with username "([^\"]*)" and password "([^\"]*)"$/ do |username,
@me.aspects.create(:name => "Besties") @me.aspects.create(:name => "Besties")
end end
Given /^that I am a rock star$/ do
Given('a user with username "awesome" and password "totallyawesome"')
end
Given /^a user with email "([^\"]*)"$/ do |email| Given /^a user with email "([^\"]*)"$/ do |email|
user = Factory(:user, :email => email, :password => 'password', user = Factory(:user, :email => email, :password => 'password',
:password_confirmation => 'password', :getting_started => false) :password_confirmation => 'password', :getting_started => false)